![Smile :)](./images/smilies/icon_smile.gif)
Anybody have any suggestions? Is there an easier way to do this than constructing URLs?
Thanks
-Tom
@ Garvin - there is a typo in there.. archiveS is listed twice, but "older" archives are "archive".Indicates the current "view" on the frontend. One of: "archives, entry, feed, admin, archives, plugin, categories, authors, search, css, start, 404"
Scope: *.tpl
Code: Select all
$serendipity['smarty']->assign(array('currpage'=> "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']));
Code: Select all
{if $currpage==$serendipityBaseURL}
I'm a little swamped currently, but I'll test it asap. Until then, I'm leaning back to see what Garvin has to sayDon Chambers wrote:@YL - The full definition of which pages get "start" is not listed, but in my own quick test I noticed the base page, contact form, static pages and possibly plugin pages like my download manager all get that value for $view.
Can't say I fully understand it, but it works, at least for detecting single entry, static page, or start page. 404 pages apparently still need $view == 404, but that's not an issues.Don Chambers wrote:You might want to use the BP method for $currpage in config.inc.php:
and this for detecting the start page (which could also be flawed for all I know):Code: Select all
$serendipity['smarty']->assign(array('currpage'=> "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']));
@ Garvin again - is there a better way to detect the front/base/start/home domain page than what I just listed?Code: Select all
{if $currpage==$serendipityBaseURL}
I understand it, but I just wanted input from those who know a lot more than I. There might, or might not, be a better way to detect the front page. I am successfully using the code I gave you with static pages, regular pages, and a variety of plugins. I just do not know if this is the best possible method, especially with URL rewriting and a few other scenarios I can think of. Just trying to help.yellowled wrote:Can't say I fully understand it, but it works, at least for detecting single entry, static page, or start page. 404 pages apparently still need $view == 404, but that's not an issues.
If Garvin doesn't veto this or come up with something even better, we could update the mimbo in spartacus asap.
YL
I'm sorry, but how/where should I check this? If I add a <p>{$category_info}</p> to index.tpl, the output is "Array", if that's of any help.garvinhicking wrote:Inside the template you might want to check if $category_info is set to detect if a fixed category is used. The category view is really only applied if a category view permalink is used, I'm afraid.