I am trying to work out how the news module links can look pretty. When you have a limit on the number of items per page and you get the page navigation, the pretty urls dont apply on the next page links.
You are presented with dynamic urls rather than pretty urls.
Is there something you can do to fix this.
I have again tried to google for an answer with no luck.
So instead of the next page link looking like this:
index.php?mact=News,m4329d,default,1&m4329dnumber=6&m4329dpagenumber=2&m4329dreturnid=59&page=59
Would be better to have something like:
news-2.html
Many thanks
Barry
News module pretty urls
Re: News module pretty urls
If you enable true pretty URLs they will come out like, site.com/1/15/name-of-article.html, 1 being the article number and 15 being the page ID, that's it...
Guess it helps to read and comprehend all of the post, what Wishbone says...
I use cycle to make pagination (X amount of articles per cycle)...
http://vobuzzweekly.com/blog.html
Guess it helps to read and comprehend all of the post, what Wishbone says...
I use cycle to make pagination (X amount of articles per cycle)...
http://vobuzzweekly.com/blog.html
Re: News module pretty urls
Not for next and prev links CG says 'not gonna happen'
Re: News module pretty urls
[Off topic]Would you mind explaining how you made the archive on the frontpage. Looks very nice![/Off topic]Dr.CSS wrote:
http://vobuzzweekly.com/blog.html
Re: News module pretty urls
He's loading all the posts at once, and using a jQuery slider to show them. Very nice!
Re: News module pretty urls
Higher cmsms magic
Re: News module pretty urls
Dear Dr.CSS,
Great tip!!
I've just finished implementing a cycle2 powered pagination on my latest project, I don't know if i'll ever be able to return to regular pagination
Greetings,
Manuel
Great tip!!
I've just finished implementing a cycle2 powered pagination on my latest project, I don't know if i'll ever be able to return to regular pagination
Greetings,
Manuel
Do you like your open source cms? Buy from the CMSMS partners || Donate
Re: News module pretty urls
@Gregor or anybody else interested...
Not sure what part you are referring to but you may find the answer here, if not let me know and I will make one...
http://how-i-did-that.com/
Not sure what part you are referring to but you may find the answer here, if not let me know and I will make one...
http://how-i-did-that.com/
Re: News module pretty urls
@Dr. CSS Thanks for your link. I will go through the code and example. If I have any questions I'd like to get back to you. Many thanks.
Re: News module pretty urls
Nice Dr CSS
Here is my solution to the problem. It's a bit clunky and doesn't give you pretty URLs but it does give you clickable page numbers and saves on download time if you have lots of articles.
Also, to ensure the session var is cleared, I put
{if $page_alias ne 'articles'}{session_erase var='pagecount'}{/if}
in the template header.
Here is my solution to the problem. It's a bit clunky and doesn't give you pretty URLs but it does give you clickable page numbers and saves on download time if you have lots of articles.
Code: Select all
{strip}
{if !isset($smarty.session.pagecount)}
{session_put var=pagecount value=$pagecount}
{else}
{assign var=pagecount value=$smarty.session.pagecount}
{/if}
{if $pagecount gt 1}
{capture assign=pagenumbering}
{assign var=num value=1}
{if !empty($smarty.get.cntnt01start)}
{assign var=currentpage value=$smarty.get.cntnt01start/$param_pagelimit}
{else}
{assign var=currentpage value=1}
{/if}
<ul class="pagination">
<li class="arrow {if $current lt $pagelimit} unavailable{/if}">
<a href="{module_action_link module='News' action='default' urlonly=1 category='Articles' start=$goto pagelimit=$param_pagelimit}">
«
</a>
</li>
{for $foo=1 to $pagecount}
{if $num gt $pagecount}{break}{/if}
<li {if ceil($currentpage) eq $foo}class="current"{/if}>
{assign var=goto value=(($foo-1)*$param_pagelimit)+1}
<a href="{module_action_link module='News' action='default' urlonly=1 category='Articles' start=$goto pagelimit=$param_pagelimit}">
{$num}{assign var=num value=$num+1}
</a>
</li>
{/for}
<li class="arrow {if $num eq $pagecount} unavailable{/if}">
<a href="{module_action_link module='News' action='default' urlonly=1 category='Articles' start=$goto pagelimit=$param_pagelimit}">
»
</a>
</li>
</ul>
{assign var=num value=0}
{/capture}
{/if}
{if !empty($pagenumbering)}{$pagenumbering}{/if}
{foreach from=$items item=entry}
<article class="NewsSummary">
<h1 class="NewsSummaryLink">
<a href="{$entry->moreurl}" title="{$entry->title|cms_escape:htmlall}">{$entry->title|cms_escape}</a>
</h1>
{if $entry->postdate}
<p class="NewsSummaryPostdate">
<i class="general foundicon-calendar"></i> {$entry->postdate|cms_date_format}
</p>
{/if}
{if !empty($entry->authorname)}
<p class="NewsSummaryAuthor">
{$author_label} {$entry->authorname}
</p>
{/if}
{if $entry->summary}
{eval var=$entry->summary assign=temp}
<p class="NewsSummarySummary">
{$temp|strip_tags|truncate:100:''} {$entry->morelink}
</p>
{else if $entry->content}
{eval var=$entry->content assign=temp}
<p class="NewsSummaryContent">
{$temp|strip_tags|truncate:100:''} {$entry->morelink}
</p>
{/if}
</article>
{/foreach}
{if !empty($pagenumbering)}{$pagenumbering}{/if}
{/strip}
{if $page_alias ne 'articles'}{session_erase var='pagecount'}{/if}
in the template header.