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.

need to hack search:custom_field search:custom_field_2 to return either rather than both

December 01, 2010 3:10pm

Subscribe [4]
  • #1 / Dec 01, 2010 3:10pm

    joelene

    87 posts

    Firstly, I am really REALLY sorry to haev posted this elsewhere - well aware of poor etiquette but I very much need an answer.

    My problem is I have weblog being administered by different group_id’s - on any news listing page the list is confined to the current group_id’s posting plus an admin group_id who makes their news articles appear within the listing by setting a custom field to “yes”. Not like a sticky in that they don’t stick to the top of the list.

    I need to only show the admin entries that are selected as being global but I need the pagination to work correctly hence I can’t remove listings using conditionals as it will show less than 6 items per page hence I am trying to use a pair of search:custom_field statements to look for

    a) items from the global admin that are marked “yes”
    b) items that are from the current group_id ie search:custom_field_2=“6” (where the six has been added into a custom field)

    Ideally I would do this with a query to return a paginating list of items that are posted by group_id 6 and those from the global admin marked “yes”.

    At the moment I would be content with hacking the are of the weblog module that says search:custom_field and search:custom_field_2 return only entries that meet both conditions rather than either condition.

    I am willing to pay for help with this as time is running out….

    [Mod Edit: Moved to the CodeShare Corner forum]

  • #2 / Dec 02, 2010 9:57am

    Sue Crocker

    26054 posts

    joelene, do you just need the title, or do you need to pull other items?

  • #3 / Dec 02, 2010 9:59am

    joelene

    87 posts

    Hi Sue (again sorry for cluttering your forum)

    I need to grab the url_title, the date, the title, the bodytext and possibly the group_id of the publisher (not so sure I need the last one) - the bodytext is a custom field.

    Ooof.

  • #4 / Dec 03, 2010 2:33am

    John Henry Donovan

    12339 posts

    joelene,

    {exp:weblog:entries group_id="1|6" weblog="news"  orderby="date"  limit="15" }
    content
    {/exp:weblog:entries}

    have you looked into using the group_id= parameter?

  • #5 / Dec 03, 2010 4:58am

    joelene

    87 posts

    Hello John

    yes, the group_id is limited to the current language (ie a german member) plus the global admin person.

    ie group_id=”{member_group_id}|6” where 6 is global and member_group_id is dynamic depending on language.

    I only want the entries with custom field is_sticky to be intermingled from the global admin. But using the conditionals messes up the limit and hence pagination - i need to pre filter the results before it paginates. I want to use the search:custom_field but I don’t want to return entries that meet both search:custom field parameters, i want either.
    Hope that makes sense…

  • #6 / Dec 03, 2010 4:03pm

    Sue Crocker

    26054 posts

    You’re best results are going to come from a custom query, which is more of a CodeShare Corner question. How comfortable are you with using the query module?

  • #7 / Dec 03, 2010 5:20pm

    joelene

    87 posts

    Pretty uncomfortable really 😊 - I would hugely appreciate some help!

  • #8 / Dec 04, 2010 5:44pm

    Greg Salt

    3988 posts

    Hi Joelene,

    The CodeShare Corner is the most appropriate place for this question. I’ll move this thread over there for you so that you can get some community assistance.

    Cheers

    Greg

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

ExpressionEngine News!

#eecms, #events, #releases