Just going properely with EE in the last few days.
Iv read numerous posts asking for some kind of straight url structure and been experimenting with different methods.
Most of my pages are in the same format so i didnt really see a point in making numerous repeated templates so iv made a kind of ‘oop’ code structure. I understand its advised to use templates to structure data but this to me is cleaner and more ‘resuable’. I could be missing some crucial part understanding of EE though…
Not sure if this is of any use to anyone and there may well be parts that could work better so feel free to post changes, but it may help any newbies out there looking for some kind of quick way to get categories and subc’s working.
http://www.domain.com/category/sub-category/page_url
{embed="file" main_catter="enter root cat id here"}{if segment_2=="" AND segment_3==""}
{exp:subcategories root_node="{embed:main_catter}"}
<li><a href="http://{path=">{category_name}</a></li>
{category_description}
{/exp:subcategories}
{if:elseif segment_2!="" AND segment_3==""}
{exp:query sql="SELECT cat_id FROM exp_categories WHERE cat_url_title = '{segment_2}'"}
{exp:weblog:entries weblog="web-pages" category="{cat_id}" dynamic="off" sort="asc"}
<li><a href="http://{title_permalink={segment_1}/{segment_2}}">{title}</a></li>
{summary}
{/exp:weblog:entries}
{/exp:query}
{if:elseif segment_3!=""}
{exp:weblog:entries weblog="web-pages" url_title="{segment_3}"}
<h1>{title}</h1>
{body}
{/exp:weblog:entries}
{/if}Pleae post any methods that will work better and feel free to move this to a better section mods. Hope it may be of use to someone