[SOLVED] Replace or style << < > >> arrows in CGBlog

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Thomasl
Forum Members
Forum Members
Posts: 24
Joined: Thu Jan 17, 2008 7:23 am

[SOLVED] Replace or style << < > >> arrows in CGBlog

Post by Thomasl »

Hey,

I tried to search the whole board, but did not find a solution. Does anyone know where I can access these arrows and change/style them to something a bit more modern?

I'm referring to this part of the blog template:

Code: Select all

{if $pagecount > 1}
<p style="text-align:center;">
{if $pagenumber > 1}
{$firstpage} {$prevpage} 
{/if}
Page {$pagenumber} {$oftext} {$pagecount}
{if $pagenumber < $pagecount}
  {$nextpage}  {$lastpage}
{/if}
</p>
{/if}
Last edited by Thomasl on Sun May 08, 2011 2:54 pm, edited 1 time in total.
uniqu3

Re: Replace or style << < > >> arrows in CGBlog pagination

Post by uniqu3 »

I usually wrap these in <span> like <span class="prev">{$prevpage}</span>

And style it with css

span.prev a{
width:YOURWIDTpx;
height: YOURHEIGHTpx;
text-indent:-9999px;
display:block;
background: #HEX url(path/to/arrow-as-background-image.gif) no-repeat;
}

You could also use smarty replace http://www.smarty.net/docs/en/language. ... eplace.tpl
{$prevpage|replace:'<':'&laquo;'} for «
Thomasl
Forum Members
Forum Members
Posts: 24
Joined: Thu Jan 17, 2008 7:23 am

Re: Replace or style << < > >> arrows in CGBlog pagination

Post by Thomasl »

Thanks for the fast reply.

But would not replacing the > or < with smarty also replace the <a>-tags and break up the whole link (that's at least what happened when i tried)? :)

Styling with span works if using images. But I would want to replace the arrows with text, something like "Newer" and "Older".
uniqu3

Re: Replace or style << < > >> arrows in CGBlog pagination

Post by uniqu3 »

Soory my bad, didn't think about it :-)

Ok create new folder in your cms root called module_custom
In that folder create new folder CGBlog
Now go to folder /modules/CGBlog and copy /lang folder to your newly created /module_custom/CGBlog.

Now open file en_US.php in that folder and edit from line 166:

Code: Select all

$lang['firstpage'] = '<<';
$lang['prevpage'] = '<';
$lang['nextpage'] = '>';
$lang['lastpage'] = '>>';
For example

Code: Select all

$lang['firstpage'] = 'And of you go to first page';
$lang['prevpage'] = 'Would you like to go back';
$lang['nextpage'] = 'Come on read more go to next page';
$lang['lastpage'] = 'The End';
Dont simply edit that file in modules/CGBlog/lang as it will be lost on next update and you will have to do it all over again. Use module_custom
Thomasl
Forum Members
Forum Members
Posts: 24
Joined: Thu Jan 17, 2008 7:23 am

Re: Replace or style << < > >> arrows in CGBlog pagination

Post by Thomasl »

Great! Thank you so much for the advice, that should do the trick. :)
mskeet
Forum Members
Forum Members
Posts: 22
Joined: Sat Jan 10, 2009 6:59 pm

Re: [SOLVED] Replace or style << < > >> arrows in CGBlog

Post by mskeet »

Does anyone know how to make the pagination to look and act like those used in wordpress?

What I mean is that the default code

Code: Select all

<div id="blog">
{if $pagecount > 1}
<div class="details">
{if $pagenumber > 1}
{$firstpage} {$prevpage}
{/if}
{$pagetext} {$pagenumber} {$oftext} {$pagecount}
{if $pagenumber < $pagecount}
{$nextpage} {$lastpage}
{/if}
</div>
{/if}
will output something like this

Code: Select all

<< < Page 2 of 9 > >>
Instead, how do we should change the code to output something like this:
Image
?
Post Reply

Return to “Modules/Add-Ons”