EditWrx Knowledge Base Home
 Search       Login   Register   Members   Help   Home 
Search by username

EditWrx Knowledge Base > Open End User Forum > Block Editing > Includeblocks: What am I doing wrong?

Includeblocks: What am I doing wrong?
 Moderated by: Keith  
 New Topic   Reply   Print 
AuthorPost
Rob
Member
 

Joined: Wed May 25th, 2005
Location:  
Posts: 21
 Posted: Sun Oct 30th, 2005 09:38 pm
 Quote  Reply 
Hi Keith!

I'm taking a stab at includeblocks.  I'm building a community to allow users to create their own sites.    Each user will have their own folder with a main index.php file and a common header / footer file.   I'm also going to have a menu.inc file in each folder so each user can create their own menu in their respective folder.

Well, I can't get it to work.  I can get the red dotted line to show up around the included file contents and I can edit it, but when I hit save it reverts to the original menu.inc file's content.

My includeblock is:

<div includeblock="menu.inc">
<?php include ("menu.inc"); ?>
</div> 


The menu.inc file only has the wor menu in it.

I've tried everything including:
  1. Changing the permissions of menu.inc to 777
  2. putting editblock code into the menu.inc file (changed the red boarder to green)
  3. Gave my user super user privilages.
  4. Did different combos of menu.inc and menu.php
I can't figure out how to get the edits in the menu.inc file to stick / save.

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 578
 Posted: Mon Oct 31st, 2005 01:30 pm
 Quote  Reply 
It's the path to menu.inc Rob. EditWrx is running as wrx.cgi and wrx.cgi is not in the same folder as your menu.inc, so you need to tell wrx.cgi where menu.inc is at. Since you've given it "the same folder" path in the includeblock value, wrx.cgi has probably written menu.inc in the same folder as wrx.cgi is in. To tell wrx.cgi where to write menu.inc you need to include a virtual path to it in the includeblock value.

For example, if that user's menu.inc is at http://yourDomain.com/sally/menu.inc the includeblock would be


<div includeblock="/sally/menu.inc">
<?php include ("menu.inc"); ?>
</div> 

To create a virtual path, remove the host part of the url. A virtual path must begin with a slash and travel from the domain's home folder to the file.

BTW, never give any file or folder 0777 permissions. It can give you very unexpected results.

Rob
Member
 

Joined: Wed May 25th, 2005
Location:  
Posts: 21
 Posted: Tue Nov 1st, 2005 02:40 am
 Quote  Reply 
Keith, again you've proven you are the master!   It workes as  you suggested.

My issue now is this:  In your example I need to specify the folder "sally".  What do I do if I'm using this with my community builder and want to give everyone the ability to create their own menu structure that is only within their respective folder?

Each time a new user is created a new folder is created which means I'll have a different vitrual path to my menu.inc file for each user.

Is there a way around this?

Thanks again!

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 578
 Posted: Tue Nov 1st, 2005 03:41 pm
 Quote  Reply 
Ah! I see your problem. If the new user is created dynamically the include on their template page also needs to be dynamically pointing to the include in their folder.

This requires an update 6.10.051101. Details on how to change the includeblock path are at http://www.editwrx.com/forums/forum4/8.html 


 Current time is 04:57 pm




Powered by WowBB 1.62 - Copyright © 2003-2004 Aycan Gulez