Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: Article Manager 2:
Relative path

 

 


diness
User

Feb 6, 2007, 2:31 PM

Post #1 of 14 (823 views)
Shortcut
Relative path Can't Post

I had to include a file on all my category pages, however I could not find a placeholder for the the relative path to my publish folder. For example ../../

This path is changing in different levels along with the menues / articles.
I made it work with template if, however I think a relative path placeholder would be great.

I tried the publish.dir or something like this, but this have the /var/httpdocs.... path, witch could not be used.

Is there a way to made relative path?
If not it could be an idea to put that feature in the future.

/ Daniel


Donna
Staff / Moderator


Feb 6, 2007, 3:48 PM

Post #2 of 14 (819 views)
Shortcut
Re: [diness] Relative path [In reply to] Can't Post

Hi there,

We generally recommend using relative paths, as they only work in very specific folders. Instead, you can use the virtual path. ie, instead of ../../publish, you would have /artman2/publish -- adding the slash to the front tells it to go back to the web root. This makes sure that the path works in all locations on the server.

However, Article Manager generally pulls in all of the correct paths itself for anything dynamic. Can you let me know what exactly you need the path for?

For example, the default SSI code to include the category list would be:


<!--#include virtual="$published.globalMenu.webpath$" -->

So, the "webpath" modifier tells it to use the /full/path/to/the/directory.

Let me know if you have any other questions, or if you're still stuck. :)

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


diness
User

Feb 6, 2007, 3:52 PM

Post #3 of 14 (818 views)
Shortcut
Re: [Donna] Relative path [In reply to] Can't Post

I have search engine that i include ( not yours )
I use ssi to put it in, however my ssi will not work with the other path
/full/path/to/the/directory
Just returns an error.


Donna
Staff / Moderator


Feb 6, 2007, 4:23 PM

Post #4 of 14 (816 views)
Shortcut
Re: [diness] Relative path [In reply to] Can't Post

Hi there,

Can you give the full syntax that you're using? There are a few different SSI syntaxes used for different purposes.

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


diness
User

Feb 6, 2007, 4:32 PM

Post #5 of 14 (815 views)
Shortcut
Re: [Donna] Relative path [In reply to] Can't Post

At the moment i use this code :
<!-- templateIf : $category.depth$ == '0' -->
<!--#include virtual="../search/search.php" -->
<!-- /templateIf -->
<!-- templateIf : $category.depth$ == '1' -->
<!--#include virtual="../../search/search.php" -->
<!-- /templateIf -->
<!-- templateIf : $category.depth$ == '2' -->
<!--#include virtual="../../../search/search.php" -->
<!-- /templateIf -->
<!-- templateIf : $category.depth$ == '3' -->
<!--#include virtual="../../../../search/search.php" -->
<!-- /templateIf -->


Donna
Staff / Moderator


Feb 6, 2007, 5:04 PM

Post #6 of 14 (812 views)
Shortcut
Re: [diness] Relative path [In reply to] Can't Post

Ouch, yeah, that's a bit ugly.

Have you tried this?

<!--#include virtual="/search/search.php" -->

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


ironsoup
User

Feb 7, 2007, 1:57 PM

Post #7 of 14 (795 views)
Shortcut
Re: [Donna] Relative path [In reply to] Can't Post

I have a bit of a trickier situation. Basically, we use the php extension and thus all our templates for articles and category pages are .php files, that contain php require("") statements when including headers, footers, etc. While this has worked out great for the article pages and category pages, the search page is giving us issues. Basically in our php require statements we are telling it to go up 2 directories (../../) to get to the general includes/ directory containing the header and footer. Since the search / prev-next page template always processes from within cgi-bin/artman2/... it breaks our system, as our general publishing structure is:
website.com/publish/category/(articleXXX.php / index.php). I can't use a <!--#include virtual="/includes/header.php" --> because I get an error stating I can't do that when using SSI Emulation? I don't recall doing a <!--virtual include on a php file in article manager 1 to be a problem.

And lastly, you can't do <? require('/includes/header.php'); ?> because it's server side so it tries to look at the root of the server as opposed to the root of the website (at least with our current hosting setup.)

Are there any options for us with the system we are using? I couldn't find a search template in the templates/publish rules section. I was hoping the search.cgi could be changed to a php file perhaps.

Anyways, I'd be happy to hear any advice you have on the topic. Thanks again!

-Mike


Donna
Staff / Moderator


Feb 7, 2007, 2:06 PM

Post #8 of 14 (793 views)
Shortcut
Re: [ironsoup] Relative path [In reply to] Can't Post

Hi Mike,

Essentially, the same thing, except you'd use the full path from the root. :)

For the pages that Article Manager generates, you can use the filepath placeholder that includes the full path like this:


<?php include('$published.globalMenu.filepath$'); ?>

For non-Article Manager pages that you want to include, you'd have something like this:


<?php include('/var/www/includes/header.php'); ?>

...except replacing the /var/www/ part with the actual path to the directory you want. :)

I'm not sure if you're aware, but there's an option in the Publish Rules that you can use to convert all of your SSI's to PHP includes, and vice versa. Scroll to the bottom of the page and take a look in the bottom left corner. One of the options on the dropdown list will do this for you. :)

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


ironsoup
User

Feb 7, 2007, 2:13 PM

Post #9 of 14 (792 views)
Shortcut
Re: [Donna] Relative path [In reply to] Can't Post

Well, there's one thing I failed to mention. Basically, how can the php includes even work? It's loading the tabulated pages for prev/next through search.cgi so the php lines are showing up in the webpage source!

For example, when I go to next from the first index page and it goes to page 2 using search.cgi, and I view the source code I actually see the php code! So it's not processing the php like it should, although I guess that's normal since it's a search.cgi instead of search.php.

So essentially I think my problem transcends the issue of relative vs. absolute paths :)


Example:
(html/client side source code of search.cgi)
------------------------------------------------
...

<script src="/includes/common.js" type="text/javascript"></script>
</head>

<body id="indexPage">


<?php
require('../../includes/data.php');
require('../../includes/_site/leaderboard.php');
?>

<center>

...
------------------------------------------------


ironsoup
User

Feb 7, 2007, 2:14 PM

Post #10 of 14 (791 views)
Shortcut
Re: [Donna] Relative path [In reply to] Can't Post

...And the convert SSI to PHP and vice versa wouldn't help because if I do that while it would fix the php includes in the search.cgi, it would break all the php includes on the regular article and category index pages, right?


Donna
Staff / Moderator


Feb 7, 2007, 2:54 PM

Post #11 of 14 (787 views)
Shortcut
Re: [ironsoup] Relative path [In reply to] Can't Post

(edited)

Sorry about that, I missed the first response. :)

Article Manager allows you to use PHP, SSI, or any other dynamic code in the search pages. It creates a temp page, reads from that, and pulls the content in directly. So yes, PHP includes work fine on the search templates as well as the regular pages.

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


(This post was edited by Donna on Feb 7, 2007, 2:55 PM)


ironsoup
User

Feb 7, 2007, 6:19 PM

Post #12 of 14 (782 views)
Shortcut
Re: [Donna] Relative path [In reply to] Can't Post

Then why are the php statements showing up in the source view of search.cgi? Is there something I need to enable in the admin to allow search.cgi to correctly interpret the php statements?


Donna
Staff / Moderator


Feb 8, 2007, 8:57 AM

Post #13 of 14 (767 views)
Shortcut
Re: [ironsoup] Relative path [In reply to] Can't Post

The only thing you should have to do is make sure that the temp pages are being created with .php extensions. To do this, go into Admin and choose General Settings. Make sure "Server Resolved" is chosen, and that the extension is .php... and that should do it. :)

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


ironsoup
User

Feb 8, 2007, 9:42 AM

Post #14 of 14 (764 views)
Shortcut
Re: [Donna] Relative path [In reply to] Can't Post

It worked! You truly rock. Many thanks.

-Mike

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4