[pmwiki-users] Conditional If statement being displayed on web page?
Matt Clinton
mclinton at 65bit.com
Tue Oct 8 04:23:52 CDT 2013
Hi Petko,
Worked like a dream and was easier to set up than anything else! Thanks :)
Regards,
Matt Clinton
65bit Software Limited
www.65bit.com
On 8 Oct 2013, at 10:16, Matt Clinton <mclinton at 65bit.com> wrote:
> Hi Petko,
>
> Thanks, I am definitely going to give this a go. The AllGroupHeader did not do what I wanted it to do as it was giving me Site and then All Group Header for every page instead of that pages group and title.
>
> Regards,
>
> Matt Clinton
> 65bit Software Limited
> www.65bit.com
>
>
>
>
> On 7 Oct 2013, at 21:02, Petko Yotov <5ko at 5ko.fr> wrote:
>
>> Here is a piece of code that I use for a similar need. In config.php:
>>
>> function GroupTitle($group, $slash=0){
>> global $AsSpacedFunction;
>> $title = PHSC(PageTextVar("$group.GroupConfig", 'GroupTitle'));
>> if (! $title>'') $title = $AsSpacedFunction($group);
>> return $slash ? "$title /" : $title;
>> }
>> $FmtPV['$GroupTitle'] = 'GroupTitle($group)';
>> $FmtPV['$GroupTitleTMPL'] = 'GroupTitle($group, 1)';
>>
>> In a wiki page [[EasyCatalog.GroupConfig]] or [[OtherGroup.GroupConfig]] I have this code:
>>
>> GroupTitle:EasyCatalog (or any other group title I don't want "spaced")
>>
>> In the skin template, I use $GroupTitle or $GroupTitleTMPL where I want the group title displayed (and $Group where I link to the group unspaced) :
>>
>> <title>$WikiTitle | {$GroupTitle} / {$Title} $ActionTitle</title>
>> <a href='{$ScriptUrl}/{$Group}'>{$GroupTitleTMPL}</a>
>>
>> In a [[SideBar]] or any other wiki page, I can use {*$GroupTitle}.
>>
>> This way, if there is a page EasyCatalog.GroupConfig with the page text variable GroupTitle, it will be used as a group title in the skin template. If there isn't such a page or such a variable, the skin will show the "group spaced" text as title.
>>
>> Petko
>>
>> P.S. $GroupTitleTMPL only has a slash appended - not sure why I needed that.
>>
>> Matt Clinton writes:
>>> The problem lies not with the page title but with the Group name. I want to use $Groupspaced so that "ODBCDataProvider" is spaced out on this page: <URL:http://impressedpaving.co.uk/matt/index.php?n=ODBCDataProvider.ODBCDataProviderNotLoadingOnMacintosh>http://impressedpaving.co.uk/matt/index.php?n=ODBCDataProvider.ODBCDataProviderNotLoadingOnMacintosh
>>>
>>>
>>> But if I was to do this, the group EasyCatalog then ends up as Easy Catalog.
>>>
>>>
>>> Which is why I would love to be able to use an IF statement in my tmpl file.
>>>
>>
>> _______________________________________________
>> pmwiki-users mailing list
>> pmwiki-users at pmichaud.com
>> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20131008/4c3e74d0/attachment.html>
More information about the pmwiki-users
mailing list