You Are Here: WebCrimson Home > Webcrimson Support

WEBCRIMSON SUPPORT



Using Editing Interface: Index Template Tags

 

WebCrimson's Page Template tags are pretty straightforward.

Use This Sample Code:





by

 

 

And You'll Get a Page That Looks Like:

Title
Summary
by Author

 

 

But imagine for a moment that you're on a page that requires an Index template:

Article Index:

 

Like our Page Template example above, we want to display several elements:

Title
Summary
by Author

 

But we also want to repeat those three elements over and over again, so we can create an Index of the last 10 Articles.

In order to pull that off, we're going to need some extra template tags just for Index Templates.

Introducing ENTRYBLOCK

In order to achive that repeating effect in our Index Template, we can just wrap the code we want to repeat in some entryblock tags.

whatever HTML you'd like to repeat

That's all there is to it.  Here's an example of that code for a Index Template for Articles:

Use This Sample Code:

   
   
   

   
    by
 

And You'll Get a Page That Looks Like:

June 2001
Title #1
Summary #1

by Author #1

June 2001
Title #2
Summary #2
by Author #2

July 2001
Title #3
Summary #3
by Author #3

etc.


Grouping Entries by Date

Sometimes, you may want to group your entries by years, months, or weeks.

For example, maybe you noticed in that Article Index how two of the articles were in June 2001.  The date repeats itself, which seems a bit redundant when you think about it. 

Perhaps instead, you'd prefer your Article Index to look something like this:

June 2001

Title #1
Summary #1
by Author #1

Title #2
Summary #2
by Author #2


July 2001

Title #3
Summary #3
by Author #3


etc.


See how the two entries in June 2001 are grouped together?  That's hard to pull off with just a standard entryblock. 

We'll have to add a new tag to the mix that we call a dateblock.

Here's some sample code to show how to do just that:

Use This Sample Code:


   


   
       

       
       
       by 

      
   


   

And You'll Get a Page That Looks Like:

June 2001

Title #1
Summary #1
by Author #1

Title #2
Summary #2
by Author #2


July 2001

Title #3
Summary #3
by Author #3


etc.



Back to Top


Back to
WebCrimson Support