![]() |
![]() |
||||||
|
|||||||
| Tags: gettingrewritten, headaches, includes, links, php, template |
![]() |
|
|||
|
I know this has been discussed a few times on these forums, but I've yet to
find a solution. I have several DW Templates that make use of PHP includes - some are relative ('includes/navigation.inc.php') some are absolute paths ('/home/smwc/public_html/includes/footer.inc.php') . Whenever a Contribute user saves a draft or sends a page for review these includes (which are OUTSIDE an editable region) get rewritten into relative paths. For example: The draft will get saved in domain.com/MMWIP/randomstring/randomstring.php Code before the draft is saved will be: <?php include('/home/smwc/public_html/includes/breadcrum b.inc.php'); ?> Code after the draft is published will be: <?php include('../../home/smwc/public_html/includes/brea dcrumb.inc.php'); ?> Obviously, that breaks everything. It is also doing this to all absolute paths. Stylesheets go from src="/scripts/css/style.css" to src="../../scripts/css/style.css"; even the Template line gets changed to this <!-- InstanceBegin template="../../Templates/Index-Page.dwt.php" codeOutsideHTMLIsLocked="false" --> Path links defined in the template (/about/index.php) get changed to .../about/index.php and so on.. I was a few weeks from a website launch... * sobs * Can anyone help with this? |
| Sponsored Links |
|
|||
|
OK, so I've worked on this for a little longer, and here is what I've found.
You apparently cannot use php includes like the one below <?php include('/home/smwc/public_html/someinclude.php'); ?> where you include a file from the server's root path. You can however, use an include like the one below (which does the same thing) <?php include($_SERVER['DOCUMENT_ROOT'].'someinclude.php'); ?> I am however, still having a problem with referencing images, stylesheets, and links that start at the domain's root - example -- /index.php Contribute still turns a link (to anything) that starts with a ' / ' into a relative path; resulting in ../../index.php I really didn't want to specify a domain for the resource, because we will soon be changing domain names (parallel development server) - but it looks like I'm going to have to anyway... Why can't Contribute just leave links starting with a forward slash alone!!! |
|
|||
|
glockops:
I am finishing up my first deployment of Adobe Contribute CMS for one of my clients, and I was having the same problem with PHP require(). I found the following article on the Adobe KB that contains our solution: Article: "Document relative paths pointing to items located in the Templates folders are rewritten in new pages created from templates" http://kb.adobe.com/selfservice/view...rnalId=52195a7 In the .dwt, you must surround the paths in question with a proprietary syntax which causes them to be treated as literals instead of Template Parameters, like so: <?php include("foo.php"); ?> becomes: <?php include("@@('foo.php')@@"); ?> This technique also works for any other type of relative paths to external resources such as images, scripts, stylesheets, etc. All the best, -- Connor Doyle One Orange Software |
|
|||
|
My main concern is with seeing all these complaints about this cms program why
not just switch to another? It seems like alot of people are having problems with it...not to take away from contribute because i tried it out but had many problems as well.... |
|
|||
|
<<My main concern is with seeing all these complaints about this cms program
why not just switch to another? It seems like alot of people are having problems with it...not to take away from contribute because i tried it out but had many problems as well....>> And what program would you suggest for a Mac platform? |
|
|||
|
[q]Originally posted by: xjpattx
My main concern is with seeing all these complaints about this cms program why not just switch to another? It seems like alot of people are having problems with it...not to take away from contribute because i tried it out but had many problems as well....[/q] Yeah, I didn't mean to sound tiffy... Contribute is working out rather well. It's really simple for end-users to understand so that makes my job a lot easier. And it's better than anything else that I've found so far. It just does its occasional weird thing - I'll live with that if the rest of it works. Thank you Connor! I'm sure that will come in handy! FYI - couldn't use my original account so glockops2 it is. |
|
|||
|
well wit me i just create my site in photoshop....send it to dreamweaver ...and
then i have a cms that i have that makes it real easy to make it to a website ....( i don't want to say what cms because it's not like i'm trying to advertise for them or anything) but yea it's real easy to do that ...some companies out there that do that is like reddot, interwoven, contentivity, and lots more just go on google or something and type cms and you'll get alot ....like i said i tried contribute but wasn't very satisfied with the outcome of the product but try, especially if your with a bigger company working on their website, another cms. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise