ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Entries based on Dynamic URL category AND coded category

June 27, 2007 3:42pm

Subscribe [1]
  • #1 / Jun 27, 2007 3:42pm

    davenport

    67 posts

    I have a category page and I want to have different sections on that page that display the entires from that category as well as another.

    For the entries I select 2 categories - the “page” and the “section” kind of.

    {exp:weblog:category_heading weblog="ministries"}
    {exp:weblog:entries weblog="ministries" category="329&{category_id}"}
    {ministry_body}
    {/exp:weblog:entries}
    {/exp:weblog:category_heading}

    But it doens’t work - ESSENTIALLY: how can I make expression engine pull the dynamic category from the URL and also a choosen category in the code?

    I can’t just do category=“329” because ee then ignores the URL category.

    please this is making me insane.

  • #2 / Jun 27, 2007 3:46pm

    Lisa Wess

    20502 posts

    Would you would need to do, if I am following, is to use 329&{segment_3} - the problem is that segment three is either going to be a category name, or a C12.  If the former you’d need a query to extract the ID; if the latter then you’d need some PHP to strip the C so that the ID was a number only for the category=.

    I’m not quite following your code, though.  I take it you’re trying to pass the cat_id using that as the trick?  You might try {cat_id} just in case, as that’s a quick test. Though we definitely recommend that kind of nesting as the weblog entries tag is a very powerful tag and takes a bit of processing.

  • #3 / Jun 27, 2007 3:58pm

    davenport

    67 posts

    the function i want seems simple, just hard to do.

    the url looks like this
    ROOT.com/ministries/details/view/men

    i want to select the entries in the men category (from the url above) as well as another category that the entries are in.. which is 329.

    it would be so much easier if there was a parameter to change the default action of the entry tag… from not using the category selected in the url when category=”#id” is present to processing that in addition to category=”#id”...

    this is kind of a unique case - maybe - but i really need this functionality - any idea what i could do?

  • #4 / Jun 27, 2007 3:59pm

    davenport

    67 posts

    >_<

  • #5 / Jun 27, 2007 4:02pm

    Lisa Wess

    20502 posts

    Well you can use dynamic=“off” to stop the URL lookup, but I didn’t follow the rest of that post….

    I think that a custom query and some PHP is going to be your best bet here.

  • #6 / Jun 27, 2007 4:09pm

    davenport

    67 posts

    let me quote the ee docs

    Note:Using this parameter will automatically cause ExpressionEngine to ignore any category information specified via the URL. For instance, if you are on a “category page” (e.g. a “/C13/” segment in the URL) that will be completely ignored in favor of whatever you have specified via the parameter.

    basically i don’t want it to do that.

  • #7 / Jun 27, 2007 4:14pm

    Lisa Wess

    20502 posts

    You actually do want it to do that, I think. Allow me to explain.  With dynamic set to on, EE will use the information in the URL *unless* you are using a parameter that overrides that such as category=.  The two can’t really work together.  What I think you will need to do to accomplish your goal is turn dynamic off, and set it to look for the URL our way - by using a segment with the appropriate query/php as mentioned in my earlier response.  So it’ll still be looking at the URL - but the way you tell it to, rather than by default.

  • #8 / Jun 27, 2007 4:26pm

    davenport

    67 posts

    when ever you have category=”#id” is it basically like dynamic=“off”

    i could just use segment_4 but i don’t want numbered categories - i want them to be text.. C# is retarded.

    for each category page, different types of information need to be displayed - each put in separate parts of the page.

    so like each entry has the category which defines it to the category page, then also the category that defines it to each section of that page

    view my working here
    http://www2.petrafel.org/ministries/details/view/men

  • #9 / Jun 27, 2007 4:35pm

    Lisa Wess

    20502 posts

    Like I said above, I believe that what you’ll need to do is grab the category information from the URL and use PHP and a query to find the ID - then pass that into your weblog entries tag.  I tested your nesting and it didn’t work for me either (just blank), so you’ll probably need to work on another solution involving php and a query.

  • #10 / Jun 27, 2007 4:36pm

    davenport

    67 posts

    ok sounds reasonable. are there support pages for mysql query? im clueless

  • #11 / Jun 27, 2007 5:10pm

    davenport

    67 posts

    nevermind that… i found the page.

    i wish i would have known about the db query earlier - lets me do all the stuff i wish i could do 😊

    thanks for your help

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases