| Author | Post |
|---|
Keith Moderator
| Joined: | Fri Apr 8th, 2005 |
| Location: | |
| Posts: | 578 |
|
Posted: Mon May 23rd, 2005 03:00 pm |
|
An IncludeBlock contains a SSI - ASP - PHP server side include.
The content of the includeblock in the browser overwrites the included file. An includeblock may be used for an include file that is shared by multiple files, such as a navigation link block.
One way to use includeblocks in a multi-user environment is to use an SSI to place a navigation block on all pages. Place the navigation block outside of editblocks and do not place the navogation block inside of an includeblock. Then, on one page that the site admin can access but other users can not, place that navigation block inside an includeblock. With that setup, only admin can change the site's navigation and the change is carried over to all other pages.
An Includeblock does not require a closing comment after the block's close tag.
Source code example for SSI or ASP include:
<div includeblock="/path/navigation.inc">
<!--#include virtual="/path/navigation.inc" -->
</div>
- Note that the path for the SSI tag and the includeblock value must begin with a slash / and is the path from the domain's root folder to the file (a URI path)
PHP includes can also be used in includeblocks. An example:
<div includeblock="/path/navigation.inc">
<?php include ("../path/navigation.inc"); ?>
</div>
- Note that the includeblock must use the URI type path, but the PHP include must use a relative path (PHP is clueless about the URI standard)
|
Keith Moderator
| Joined: | Fri Apr 8th, 2005 |
| Location: | |
| Posts: | 578 |
|
Posted: Tue Nov 1st, 2005 03:26 pm |
|
The 6.10.051101 update adds a new way to use IncludeBlocks for Folder Restricted users.
Problem: Suppose you have a template page for new users and the page has an include for a file that will be in the users Restricted Folder. If you are creating new users dynamically, the path in the value of the includeblock attribute would need to be a dynamic path to the user's folder instead of a virtual path to a fixed location.
Fix: If the path in the includeblock value begins with the word userFolder, editwrx will convert the word userFolder to the path to the user's folder. For example:
Suppose sally is restricted to http://domain.com/members/sally and the include is at http://domain.com/members/sally/menu.inc . The includeblock
<div includeblock="userFolder/members/sally/menu.inc">
would dynamically point to the correct file for writing changes to.
IMPORTANT: Unlike a virtual path used in an includeblock's value, do not begin this type of includeblock value with a slash (/). The absence of the slash tells editwrx to make the conversion. If you use "/userFolder/members/sally/menu.inc" editwrx will look for a folder named userFolder instead of doing the conversion.
|
JibbyJones Member
| Joined: | Sun Apr 2nd, 2006 |
| Location: | |
| Posts: | 17 |
|
Posted: Sun Apr 9th, 2006 10:49 pm |
|
<div includeblock="/path/navigation.inc" userblock="sally">
<?php include ("../path/navigation.inc"); ?>
</div> |
The above would include "../path/navigation.inc" and allow "Sally" to edit the included contents, correct?
|
Keith Moderator
| Joined: | Fri Apr 8th, 2005 |
| Location: | |
| Posts: | 578 |
|
Posted: Mon Apr 10th, 2006 05:49 pm |
|
| Correct. The includeblock follows the virtual path and php follows the relative path.
|
JibbyJones Member
| Joined: | Sun Apr 2nd, 2006 |
| Location: | |
| Posts: | 17 |
|
Posted: Mon Apr 10th, 2006 06:10 pm |
|
| But the userblock can still be used in that sense?
|
Keith Moderator
| Joined: | Fri Apr 8th, 2005 |
| Location: | |
| Posts: | 578 |
|
Posted: Tue Apr 11th, 2006 12:07 am |
|
Yes. Userblock were originally designed only for editblocks but also can be used in an includeblock.
Prior to the 6.11.060410 update the presence of any one userblock on a page required that all editblocks have a userblock. Update 6.11.060410 changes that so a userblock can be added to an editblock or includeblock without effecting other blocks.
This change allows the flexibility to add a userblock to an include that contains a site wide navigation that should be edited only by the site manager while allowing anyone otherwise authorized to edit block on the page to do so without specifying userblocks for the other blocks.
http://www.editwrx.com/user_manual/index.html#userblocks=3_5
|
JibbyJones Member
| Joined: | Sun Apr 2nd, 2006 |
| Location: | |
| Posts: | 17 |
|
Posted: Tue Apr 11th, 2006 01:09 am |
|
Thanks! I read over the manual but didn't see a notice of that.
<DIV includeblock="/includes/site_navigation.inc" userblock="DAVE">
<!--#include virtual="/includes/site_navigation.inc" -->
<DIV> |
<DIV> = </DIV>
|
 Current time is 05:18 pm | |
|