Hi joelene,
Sorry to see your post has gone unanswered for almost a week.
I had basically the exact same problem and I also had to override EE’s simple default URL format. Originally I thought that was provided for by parameters of the {exp:weblog:entries} tag such as dynamic=“off”, category, entry_id, and url_title, but it has proved to be a pain in the neck. I’ve done what I need to do, but it hasn’t been as straighforward as I anticipated.
The big problems I’ve encountered are:
* Uncertainty about the ability to supply parameter values for tags (e.g. {exp:weblog:entries}) using plugins, without which EE is only a fraction as usable (for a developer) as it could be. I don’t understand why EllisLab doesn’t document the use of plugins for parameter values, but this thread seems to give it the official seal of “approval”.
* Behavior of {exp:weblog:entries} doesn’t always make sense (e.g. not tracking views, although I was told in that thread that that would be fixed in 1.6, more or less) when manually feeding it parameters (such as ‘url_title’).
I use URLs like /template_group/template/C10/url-title on my site. I need to embed the category ID in the URL of each request to properly generate category sensitive navigation and other elements of the pages.
There are two techniques I’ve used:
* Supplying the values for {exp:weblog:entries} parameters using my plugin.
e.g.
{exp:weblog:entries dynamic="off" url_title="{exp:my_plugin:get_url_title}" parse="inward"}
...
{/exp:weblog:entries}
* Setting variables in path.php. See Path.php Global Variables
To use this technique, you might do something like:
/* In path.php */
$request_URI = explode( "/", trim( $_SERVER[ 'REQUEST_URI' ], "/" ) );
$global_vars[ 'my_category_id' ] = $request_URI[2];
$global_vars[ 'my_url_title' ] = $request_URI[3];
{!-- In your template --}
{exp:weblog:entries dynamic="off" url_title="{my_url_title}"}
...
{/exp:weblog:entries}
But if your requirements are that simple, you could probably skip setting the variables in path.php and do something like this:
{exp:weblog:entries dynamic="off" url_title="{segment_4}"}
...
{/exp:weblog:entries}
So using your URL format (I’m not 100% what each segment in your URLs represents, so don’t take this too literally):
{!-- In your templates --}
Template group: {segment_1}
Template / category group: {segment_2}
Category: {segment_3}
URL title: {segment_4}
/*
In plugin code
($IN is a global variable)
*/
$template_group = $IN->fetch_uri_segment( 1 );
$template = $IN->fetch_uri_segment( 2 );
$category = $IN->fetch_uri_segment( 3 );
$url_title = $IN->fetch_uri_segment( 4 );
Hope this helps.