Next Articles and Previous Articles

What you think other Nucleus users should know!
dunkelangst
Posts: 18
Joined: Sat Aug 03, 2013 6:02 pm

Next Articles and Previous Articles

Postby dunkelangst » Tue Aug 06, 2013 11:47 am

Hey you guys!

I only see the latest articles in any nucleus skin, when I scroll down the main page.

I just want to add a function lice that under the newest articles:

Code: Select all

  <div class="alignleft">
    <?php next_posts_link('Previous Articles') ?>
  </div>
  <div class="alignright">
    <?php previous_posts_link('Next Articles') ?>
  </div>

Is there any nucleus function available to do that?

Thank you all for your support!! :)
User avatar
slightlysome
Posts: 213
Joined: Thu Feb 24, 2011 1:33 am
Contact:

Postby slightlysome » Tue Aug 06, 2013 12:31 pm

You should be able to use the <%prevlink%> and <%nextlink%> skinvars in your skin for the index page to create previous articles links and next articles links.

An other option is to use the NP_LMBlogPaginate plugin.
- Leo -
LMNucleus CMS home page: nucleus.slightlysome.net
My Nucleus powered blogs: www.slightlysome.net - www.tswtraveler.com
My Nucleus plugins.
dunkelangst
Posts: 18
Joined: Sat Aug 03, 2013 6:02 pm

Postby dunkelangst » Tue Aug 06, 2013 3:31 pm

slightlysome wrote:You should be able to use the <%prevlink%> and <%nextlink%> skinvars in your skin for the index page to create previous articles links and next articles links.


Hey cool, thank you for your answer!!

Do you mean like that, without any Plugin?

Code: Select all

<a href="<%prevlink%>">Previous Articles</a> | <a href="<%nextlink%>">Next Articles</a>]


In this case I just get a link to my start page. Nothing happens... :(

Watch into my blog, if you want.
User avatar
slightlysome
Posts: 213
Joined: Thu Feb 24, 2011 1:33 am
Contact:

Postby slightlysome » Tue Aug 06, 2013 3:53 pm

dunkelangst wrote:In this case I just get a link to my start page. Nothing happens...

Perhaps you don't have enough items in your blog to have multiple pages. <%prevlink%> and <%nextlink%> returns blank if there is no page to link to.

You can let the skinvars generate the complete link instead of just the URL. Then you won't get links to the current page if there are no previous or next page. Like this:

Code: Select all

<%prevlink(Previous Articles)%> | <%nextlink(Next Articles)%>
- Leo -

LMNucleus CMS home page: nucleus.slightlysome.net

My Nucleus powered blogs: www.slightlysome.net - www.tswtraveler.com

My Nucleus plugins.
dunkelangst
Posts: 18
Joined: Sat Aug 03, 2013 6:02 pm

Postby dunkelangst » Tue Aug 06, 2013 4:51 pm

Thank you very much, that you help me!! :)

Perhaps you don't have enough items in your blog to have multiple pages. <%prevlink%> and <%nextlink%> returns blank if there is no page to link to.

Maybe this is the main problem. Is it easy to create them? How to do it?8O

You can let the skinvars generate the complete link instead of just the URL. Then you won't get links to the current page if there are no previous or next page. Like this:

Code: Select all

<%prevlink(Previous Articles)%> | <%nextlink(Next Articles)%>

If I do this, I only can see the pipe in my theme; please scroll down. :(
dunkelangst
Posts: 18
Joined: Sat Aug 03, 2013 6:02 pm

Postby dunkelangst » Tue Aug 06, 2013 9:10 pm

Now it works!

I use the silverside Theme. If anybody else want to have also this function, please edit the mainindex.php file:

Original mainindex.php (6 is numbers of entries on the first side):

Code: Select all

div class="content">
<%blog(silverside/index,6)%><br />
</div></div>

New one: (10 is number of entries on every side).

Code: Select all

div class="content">
<%blog(silverside/index,10)%><br />

<%nextlink(Older items,10)%> | <%prevlink(Newer items,10)%>
</div></div>

Notice: It is not necessary to use the plugin. :)
@slightlysome:
Thank you very much!! :)
User avatar
slightlysome
Posts: 213
Joined: Thu Feb 24, 2011 1:33 am
Contact:

Postby slightlysome » Thu Aug 08, 2013 10:39 pm

dunkelangst wrote:Notice: It is not necessary to use the plugin. :)

The NP_LMBlogPaginate plugin will give you links to individual pages in addition to links to the next and previous page. If you have many pages of items, will this be a benefit as it will be easier to navigate.
- Leo -

LMNucleus CMS home page: nucleus.slightlysome.net

My Nucleus powered blogs: www.slightlysome.net - www.tswtraveler.com

My Nucleus plugins.

Return to “Share Your Tips & Tricks”