Static pages, help needed variable for headline

Creating and modifying plugins.
Post Reply
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Static pages, help needed variable for headline

Post by carl_galloway »

Hi all,

I'm working on a template for another user who wants to use the static pages plugin only - no entries, just pages. Part of the design for the template is a breadcrumb trail for the static pages which corresponds with the parent/child relationship.

The breadcrumb trail only emits the headline of the page the user is on because I can't access the headline of the parent page. I know that we can identify the parent page becuase the on-page navigation links to the parent page with 'TOP'. How do I change the static page plugin to show the headline of that page instead of 'TOP'? BTW, I'm calling the breadcrumb trail from index.tpl at present, but I could easily move this the static pages .tpl files if I need to.

Adding to this question, is it possible to do the same thing with pages further down the heirarchy, so instead of just having a prent/child, could we have parent/child/grandchild, and be able to identify the headline of the child and parent if we're on the grandchild page?

Oh, before I forget, the breadcrumb trail code is as follows;

Code: Select all

<a href="{$serendipityBaseURL}">{$CONST.BLOG_HOME}</a>
    		{if $head_title && !$entry.title | $head_title != $entry.title}
      	{if $entry.title}»{/if} {$category.category_name}
    		{elseif $head_title && $entry.title}
		{if $category.category_name}
      	» <a href="{$category.category_link}" title="{$category.category_description}">{$category.category_name}</a>
		{/if}
      	{if $entry.title == $head_title}
        	» {$entry.title|truncate:40:" ...":true}
      	{/if}
    		{elseif $head_subtitle}
		» {$head_subtitle}
    		{/if}
    		{if $staticpage_pagetitle && !$entry.title}
      	» {$staticpage_headline}
    		{/if}
As you can see the relevant section is the last three lines.

I hope this makes sense, I'll be away for a couple of days so won't see any replies to this thread until Tuesday but I do need to update the static pages plugin quite urgently. If anyone is able to help, please feel free to email any code changes or updates to me webmaster [at] carlgalloway [dot] com

Thanks,

Carl
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Carl,

Breadcrumbs aren't part of the plugin.

Yet.

I'll let you know when I've finished it.
Judebert
---
Website | Wishlist | PayPal
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

hey, this sounds cool - and I think, it could be usefull for me, too:

I have a site with more than some static pages and a structure like this:

Code: Select all

page_a
 page_a_1
 page_a_2
  page_a_2_A
  page_a_2_B
page_b
 page_b_1
  page_b_1_A
but in the sidebar I want to have only page_a/_b. Or perhaps the second level page_a_1/_2, too. But not the third (or fourth) for some space reasons :-)

Now it would be fine to get a navigation/headline on page_a_2_A:

page_a :: page_a_2 :: page_a_2_A

with links to the parent pages instead of manual (and without links) via "Seitentitel für "Als Artikel formatieren"-Ansicht"
Ciao, Stephan
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Then you need the latest version of serendipity_event_staticpage! I just included code to provide a breadcrumb trail exactly like that. (Some accessories not included. Allow 6-8 weeks for shipping. Price does not include tax, tag, or title. Offer void for those that expect well-tested code.)

The breadcrumb can be found in {$staticpage_navigation.crumbs}. It's an array of static pages, but the 'name' and 'link' attributes are set just like the 'prev' link. I updated the plugin_staticpages.tpl, too, so it should just drop in.

I haven't tested this on my site, but if you're interested, give it a go and let me know what I have to fix.
Judebert
---
Website | Wishlist | PayPal
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

Then you need the latest version of serendipity_event_staticpage! I just included code to provide a breadcrumb trail exactly like that.
the "latest version"? In which version do you add your code? In the actial in the cvs? Because for this project I use some new features which I and Falk coded based on 3.36.2 on http://s9y-cms.fadoe.de/plugins/serendi ... staticpage - unfortunality falk has not insert my newest code and some bugfixes in a 3.36.3 :-(

see: http://www.s9y.org/forums/viewtopic.php ... c&start=15

But, I Can fetch the new code from the cvs until there is a new official version with these code and the new things from falk and me, or?
The breadcrumb can be found in {$staticpage_navigation.crumbs}. It's an array of static pages, but the 'name' and 'link' attributes are set just like the 'prev' link. I updated the plugin_staticpages.tpl, too, so it should just drop in.
I will take a look.
I haven't tested this on my site, but if you're interested, give it a go and let me know what I have to fix.
I will see, if I can add your code in my temp-version, I will try it.
Ciao, Stephan
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

it works very, very fine! Thanks!
Ciao, Stephan
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Good to hear! Yes, I used the CVS version; if Falk wants to make some bugfixes/updates, he can just merge his code. There are lots of good merge tools for free: WinMerge, xxdiff, and k3diff are my favorites.
Judebert
---
Website | Wishlist | PayPal
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Thanks jude for your help, I'll go and test it now.

Carl
Post Reply