<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>archGFX &#187; CMS</title>
	<atom:link href="http://archgfx.net/tag/cms/feed" rel="self" type="application/rss+xml" />
	<link>http://archgfx.net</link>
	<description>Austin web designer - Adam Freetly</description>
	<lastBuildDate>Thu, 19 Apr 2012 18:01:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>WordPress CMS: Sane Menus</title>
		<link>http://archgfx.net/blog/2006/geek/blogging/wordpress-cms-sane-menus</link>
		<comments>http://archgfx.net/blog/2006/geek/blogging/wordpress-cms-sane-menus#comments</comments>
		<pubDate>Sat, 19 Aug 2006 15:00:44 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[squible]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://archgfx.net/blog/2006/asides/wordpress-cms-sane-menus</guid>
		<description><![CDATA[Over the past couple days i've moved my entire portfolio from static HTML pages to wordpress pages. for the moment i'm using one template for all of them. With static HTML I was using 1 template per project, which let me show only the current project's pages in the side menu, and the list of [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past couple days i've moved my entire portfolio from static <acronym title='HyperText Markup Language'><span class='caps'>HTML</span></acronym> pages to wordpress pages.  for the moment i'm using one template for all of them.  With static <acronym title='HyperText Markup Language'><span class='caps'>HTML</span></acronym> I was using 1 template per project, which let me show only the current project's pages in the side menu, and the list of projects in the top menu.  (<a href="http://archgfx.net/redirection/modeling.html" title="a page in one of the projects">example</a>).  With Using 1 template, it's tempting to use <code>&lt;?php wp_list_pages() ?&gt;</code> to generate the side menu.  except that i have A LOT of pages.  38 at last count.  So I want the side menu to only show the list of projects, and the list of subpages for the current project.</p>
<p>While I could do something like hiding <code>.pagelist ul ul ul</code> in <acronym title='Cascading Style Sheets'><span class='caps'>CSS</span></acronym>, and then making <code>.pagelist ul li.current_page_item</code> visible, the nexted lists under <code>.current_page_item</code> always looked kind of stupid, since there's no way to style them individually.  So I looked to <a href="http://www.squible.com" title="my still favorite theme for hacking">squible</a>.  because I remembered <a href="http://www.karrderized.com/" title="James Carppe, Code Guru for Squibble">karrde</a> dealing with a submenu that showed other children of the current page's parent.  so now my menu looks like this:</p>
<p><span id="more-772"></span><br />
<code>&lt;div class="floatmenu"&gt;<br />
&lt;h2 id="page-title""&gt;Mapping&lt;/h2&gt;<br />
&lt;ul class="pagelist"&gt;<br />
&lt;?php wp_list_pages('exclude=164,202&amp;sort_column=menu_order&amp;depth=2&amp;title_li='); ?&gt;<br />
&lt;/ul&gt;<br />
&lt;h2 id="page-title""&gt;Contents&lt;/h2&gt;<br />
&lt;ul class="pagelist"&gt;&lt;li&gt;&lt;ul&gt;<br />
&lt;?php /* karrde is a GOD.  this comes from squible */<br />
$kids = get_pages('child_of='. $post-&gt;ID);<br />
if (count($kids) &gt; 0) {<br />
wp_list_pages('depth=1&amp;sort_column=menu_order&amp;title_li=&amp;child_of='. $post-&gt;ID);<br />
} else {<br />
if ($post-&gt;post_parent != 0) {<br />
wp_list_pages('depth=1&amp;sort_column=menu_order&amp;title_li=&amp;child_of='. $post-&gt;post_parent);<br />
}<br />
}<br />
?&gt;<br />
&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;<br />
&lt;/div&gt;&lt;!-- floatmenu --&gt;<br />
</code></p>
<p>Now we get two menus, one of which shows projects and graphics, and their subpages (sortdepth=2 hides the subpages of the projects).  The second menu shows only the children the current page, or the children of current page's parent.  Works great for pages inside a project (<a href="http://www.archgfx.net/blog/index.php/projects/redirection/modeling/" title="the same page from before, inside wordpress">example</a>), or project pages (<a href="http://www.archgfx.net/blog/index.php/projects/redirection/" title="The front page of each project is a 2nd level page.">example</a>).  But when you're looking at Projects or Graphics, you get the same sub pages listed twice.  Fixing that also fixed the styling issues with having a nested list in <code>.current_page_item</code>:</p>
<p><code>.pagelist .current_page_item li {<br />
display: none;<br />
}</code></p>
<p>HA! I love it.  This won't work for every <acronym title='Content Management System'><span class='caps'>CMS</span></acronym> use of wordpress.  It works for me because i have relatively few 1st and 2nd level pages, and a whooooole lot of 3rd level pages.</p>
<h3>Bookmark This:</h3>
<p><a href="http://del.icio.us/post?url=http://sunburntkamel.archgfx.net/2006/08/19/wordpress-cms-sane-menus/;title=Wordpress+<acronym title='Content Management System'><span class='caps'>CMS</span></acronym>+Sane+Menus"><img src="http://sunburntkamel.wordpress.com/files/2006/11/delicious.gif" alt="add to del.icio.us" /></a> :: <a href="http://digg.com/submit?phase=2&amp;url=http://sunburntkamel.archgfx.net/2006/08/19/wordpress-cms-sane-menus/"><img src="http://sunburntkamel.wordpress.com/files/2006/11/digg.gif" alt="Digg it" /></a> :: <a href="http://ma.gnolia.com/bookmarklet/add?url=http://sunburntkamel.archgfx.net/2006/08/19/wordpress-cms-sane-menus/;title=Wordpress+<acronym title='Content Management System'><span class='caps'>CMS</span></acronym>+Sane+Menus"><img src="http://sunburntkamel.wordpress.com/files/2006/11/magnolia.gif" alt="add to ma.gnolia" /></a> :: <a href="http://www.stumbleupon.com/submit?url=http://sunburntkamel.archgfx.net/2006/08/19/wordpress-cms-sane-menus/;title=Wordpress+<acronym title='Content Management System'><span class='caps'>CMS</span></acronym>+Sane+Menus"><img src="http://sunburntkamel.wordpress.com/files/2006/11/stumbleit.gif" alt="Stumble It!" /></a> :: <a href="http://www.newsvine.com/_tools/seed&amp;save?url=http://sunburntkamel.archgfx.net/2006/08/19/wordpress-cms-sane-menus/;title=Wordpress+<acronym title='Content Management System'><span class='caps'>CMS</span></acronym>+Sane+Menus"><img src="http://sunburntkamel.wordpress.com/files/2006/11/newsvine.gif" alt="seed the vine" /></a> :: <a href="http://tailrank.com/share/?text=&amp;link_href=http://sunburntkamel.archgfx.net/2006/08/19/wordpress-cms-sane-menus/&amp;title=Wordpress+<acronym title='Content Management System'><span class='caps'>CMS</span></acronym>+Sane+Menus" title="TailRank"><img src="http://sunburntkamel.wordpress.com/files/2006/11/tailrank.gif" alt="TailRank"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://archgfx.net/blog/2006/geek/blogging/wordpress-cms-sane-menus/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

