static page: staticpage-entries-listing.tpl

Creating and modifying plugins.
Post Reply
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

static page: staticpage-entries-listing.tpl

Post by Don Chambers »

I was modifying this file for a template and realized a minor revision should be made.

Current:

Code: Select all

{*  for normal static pages  *}
&raquo; <a href="{$serendipityBaseURL}{getCategoryLinkByID cid=$staticpage_related_category_id}
">{$CONST.STATICPAGE_ARTICLE_OVERVIEW}</a><br />
The above needs {$serendipityRewritePrefix} after serendiptiyBaseURL. Its also preferable to use &#187; instead of &raquo; so I would recommend this:

Code: Select all

{*  for normal static pages  *}
&#187; <a href="{$serendipityBaseURL}{$serendipityRewritePrefix}{getCategoryLinkByID cid=$staticpage_related_category_id}
">{$CONST.STATICPAGE_ARTICLE_OVERVIEW}</a><br />
I never installed cvs or svn on this new computer, so I cannot commit the change. If there are no objections, perhaps someone else can do it?
=Don=
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: static page: staticpage-entries-listing.tpl

Post by Don Chambers »

I also wanted the list of related entries to look like the output from the recent entries plugin. So, if anyone wants that (which could be committed if no one objects), change this:

Code: Select all

<ul>
    {foreach from=$entries item="dategroup"}
            {foreach from=$dategroup.entries item="entry"}
			<li class="static-entries">
        		({$dategroup.date|date_format:"%d.%m.%Y"}) <a href="{$entry.link}">{$entry.title|@default:$entry.id}</a>
			</li>
            {/foreach}
   {/foreach}
</ul>
to this:

Code: Select all

<dl>
	{foreach from=$entries item="dategroup"}
		{foreach from=$dategroup.entries item="entry"}
		     <dt class="serendipity_recententries_entrylink"><a href="{$entry.link}" title="{$entry.title|@default:$entry.id}">{$entry.title|@default:$entry.id}</a></dt>
		     <dd class="serendipity_recententries_entrydate serendipitySideBarDate">{$dategroup.date|@formatTime:"%A, %B %e. %Y"}</dd>
		{/foreach}
	{/foreach}
</dl>
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: static page: staticpage-entries-listing.tpl

Post by garvinhicking »

Hi!

Actually, get smarty function should automatically add the indexFile parameter, because the function call is routed through:

(smarty.inc.php) smarty_getCategoryLinkByID -> (functions_permalinks.inc.php) serendipity_getpermalink() -> serendipity_rewriteURL()

About the hexcode/raquo thing - just for personal interest, in which way is it better to not use raquo?

I'd prefer to not change the layout to the entrylinks output, because other people might not have that plugin installed and thus the CSS would not be applied?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: static page: staticpage-entries-listing.tpl

Post by Don Chambers »

I'm testing it with the 1.5.4 and the latest release of the static page plugin, and it does not work without {$serendipityRewritePrefix} if the site is not configured for URL rewriting.... without it, the link points to /categories/3-whatever instead of index.php?/categories/3-whatever.

As far as the definition list vs. unordered list, I put that there more for anyone who may want to use the same technique.. I do not think the recent entries plugin emits any css, so not having it installed should have no effect.
=Don=
Post Reply