Please note that you may have been redirected (you might like to make a note of the URL in the address bar of your browser and update accordingly) This is a permanent archvie but is no longer actively maintained. Please visit http://joshuaink.com for the latest updates.
Rebuild day 4 point 5
Tuesday October 26, 2004
Let's make one assumption as I dig deeper into this rebuild, I am making this shit up as I go along so don't assume for a minute that this is the "best" way to go about things, it's just my way. Onwards then...
I could get into some real waffle here about the difference (as I understand it) between Categories and Sections but instead I'll just get on and set up my Archives "Section" and hope that it explains itself. First off a quick diagram of what I want to do:

To get this done I have created a new section in Presentation > Sections called "Archives" and I have uploaded the necessary "Archive" file to the sever (see Rebuild Day 3). Now I am off to Content > Organise and from there I have created a number of new "Article Categories". For this example I have created a category especially for these notes you are reading right now and called it "textpattern".
Now every time I publish a "Rebuild Day X" note, I will assign it the Category "textpattern".

This has always been the bit that confuses me but I have come to understand Categories as an internal texpattern thing, they have no impact on the "premalink" to the article. Let's not dwell on it...
If you pop along to archives you will see a list of all the Categories currently available and clicking on any of these will produce a heading and a list of articles (best to just click "textpattern" at time of writing). First time I built my blog I got into a right mess with this idea, this time I remembered something I had read at Hicks Design and as a result I discovered the joy that is the If_category plug-in by Matthew Moss.
With that plug-in installed and activated (see Rebuild Day 3 point 5) it was just a case of adding the following code to my "default page"
- <h3>Available Archives</h3>
- <ul>
- <li><a href="/archives/?c=kitchen">kitchen</a></li>
- <li><a href="/archives/?c=mac">mac</a></li>
- <li><a href="/archives/?c=photography">photography</a></li>
- <li><a href="/archives/?c=textpattern">textpattern</a></li>
- <li><a href="/archives/?c=waffle">waffle</a></li>
- </ul>
- <txp:mdm_if_category category="textpattern ">
- <h3>Textpattern Notes Archive</h3>
- <txp:recent_articles limit="400" break="li" wraptag="ul" category="textpattern" sortby="Posted" sortdir="desc" />
- </txp:mdm_if_category>
There are a few things to discuss here. First the navigation list at the top is hard-wired where I could have used <txp:category_list /> unfortunately this is a problem because it doesn't add the /archives/ bit of the URL by default so until I work out WTF is going on this will have to stay hard-wired.
Secondly, lines 9 through 12 are repeated for each category I have available, renaming the category bits (shown in bold) to suit.
Finally, if you are awake and following along at home you will note I said I added this to my "default page" and that doesn't make any real sense because this archive list only shows up when I am at /archives and based on what I have told you thus far it should show up on every page site wide. There is another sexy plug-in involved in this illusion and I will cover this next.
Note to self: Textpatten is damn sexy!



