Archive listing

Discuss PivotX 2.0.x here. Non-PivotX related discussions go in The Drain.

Archive listing

Postby mruwa1z » Sat May 04, 2013 4:35 pm

Hello.
I'm starting to organize new webpage - http://klinrap.boo.pl and i wanted to change something in the arviche listing on that sidebar.
The point is that i want to list for example 5 newest posts and the full archive link at the bottom of that bar. Is that possible? I mean, i could to that by editing files and manually adding links but that won't be comfortable.
If i'm asking for help, it's about this site - http://klinrap.com
mruwa1z
 
Posts: 24
Joined: Sat May 04, 2013 3:37 pm

Re: Archive listing

Postby Harm10 » Sat May 04, 2013 4:51 pm

You could define a separate weblog that only contains the category you want to show. Specify that weblog name in the archive list and only entries from that weblog are shown.
Depending on your template set-up you could also code a subweblog tag just in front of the archive list. Give the subweblog a specific name and use that name on the archive list.
See what happens!
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2011
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Archive listing

Postby mruwa1z » Sat May 04, 2013 5:15 pm

Ok, i know the theory and i know how this should work but how to make it work?
The thing should be simple like changing
[[archive_list
unit="month"
order="desc"
format="<li><a href='%url%'>%st_monname% %st_year%</a></li>"
]]

to
unit="date"
...
%st_posttitle%
But it's not that simple.
If i'm asking for help, it's about this site - http://klinrap.com
mruwa1z
 
Posts: 24
Joined: Sat May 04, 2013 3:37 pm

Re: Archive listing

Postby Harm10 » Sat May 04, 2013 6:48 pm

The tag archive_list only accepts as valid values for parm unit: week, month (default) and year. So other values are disregarded.

Try a code like this:
Code: Select all
[[ subweblog name='latestentries' category='mycategory' amount=5 ]][[ literal ]]
[[* you can either do nothing or put a link to the latest 5 entries here *]]
<a href="[[ link hrefonly=1 ]]">[[ title ]]</a>
[[ /literal ]][[ /subweblog ]] 
[[* offer one link to an archive page where all 5 entries are displayed (assuming they were created in the same year *]]
[[ archive_list weblog='latestentries' unit='year' order='desc' format='<li><a href="%url%">My latest entries</a></li>' ]]   

So you can either give 5 links direct to entry detail in the subweblog loop or use that loop to "fill" an archive.
I hope this clarifies your problem.....
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2011
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Archive listing

Postby mruwa1z » Sun May 05, 2013 1:45 pm

Hi, thank you. Now i've got what i wanted.

But i have to ask you for help once again. I have edited those links' style in css but i can't find the date's style.

    Image
The code looks like this
Code: Select all
[[ subweblog name='latestentries' category='default' amount=10 ]]
[[ literal ]]
<li>&bull; [[ date format='%day%/%month%/%ye%' date=$entry.publish_date ]] - <a href="[[ link hrefonly=1]]">[[ title ]]</a></li>
[[ /literal ]]
[[ /subweblog ]] 
<li><a href="?a=2013">Wszystkie wpisy</a></li>

I just want to change the font size of the date by the links but don't know how. I've tried adding the style="" to [[date ...]] but nothing happened.

EDIT:
Ok, i've changed the global font in css. But you could help if there's a different way to do that.
If i'm asking for help, it's about this site - http://klinrap.com
mruwa1z
 
Posts: 24
Joined: Sat May 04, 2013 3:37 pm

Re: Archive listing

Postby Harm10 » Sun May 05, 2013 2:58 pm

As a general rule you can only add the parms to a smarty tag that are described in the documentation: http://book.pivotx.net/index.php?page=app-b

There are several tools around that let you see what is active html-wise on a specific web page element. I use http://chrispederick.com/work/web-developer/ which is for Chrome and Firefox. The advantage of this tool is that when you activate CSS display then clicking on an element lets you see which css definitions are applied to it.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2011
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Archive listing

Postby hansfn » Mon May 06, 2013 8:45 am

To style the date, use standard HTML and CSS:

Code: Select all
[[ subweblog name='latestentries' category='default' amount=10 ]]
[[ literal ]]
<li>&bull; <span class="latestentries_date">[[ date format='%day%/%month%/%ye%' date=$entry.publish_date ]]</span> - <a href="[[ link hrefonly=1]]">[[ title ]]</a></li>
[[ /literal ]]
[[ /subweblog ]]
<li><a href="?a=2013">Wszystkie wpisy</a></li>

and in your CSS file.

Code: Select all
span.latestentries_date {
   whatever-css-you-want;
}
hansfn
Developer
 
Posts: 3280
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Archive listing

Postby mruwa1z » Mon May 06, 2013 12:07 pm

And You my lord, You saved the day. Thanks.
If i'm asking for help, it's about this site - http://klinrap.com
mruwa1z
 
Posts: 24
Joined: Sat May 04, 2013 3:37 pm


Return to 2.x Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron