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.

Showing latest news depending on Entry ID

April 01, 2012 6:01am

Subscribe [3]
  • #1 / Apr 01, 2012 6:01am

    koogarsox

    27 posts

    Hi.

    Creating a site that has advisers which will then be shown under a certain location using categories.

    1: They want to let the advisers update thier own page - how can I do that without letting them see other pages within the channel?

    2: They want to be able to add latest news and show it on the page for the specific adviser - Please see the bottom part of the attached image.

    Now I have everything sorted up to there (adviser latest news part). How do I show the latest news depending on the adviser?

    I already has a latest news stream for the company set up as its own channel.

    Hope this makes sense.
    Thank in advance
    Amanda

  • #2 / Apr 02, 2012 1:45pm

    Dan Decker

    7338 posts

    Hi Amanda,

    Thanks for posting your questions!

    1: They want to let the advisers update thier own page - how can I do that without letting them see other pages within the channel?

    You can do this with the included SafeCracker Module. SafeCracker allows you to restrict the entry to the author, which you can set to be the advisor. It also lets the edits take place outside of the Control Panel, so you don’t have to open the backend of your site to a large group of people. See some of the examples to get an idea for how SafeCracker works.

    2: They want to be able to add latest news and show it on the page for the specific adviser - Please see the bottom part of the attached image.

    You would include a channel entries tag on the advisers template, but you would want to the set the parameter for dynamic=“no”.

    {exp:channel:entries channel="latest-news" limit="3" orderby="date" dynamic="no"}
     {title}
    {/exp:channel:entries}

    Cheers!

  • #3 / Apr 04, 2012 7:27am

    koogarsox

    27 posts

    Hi.

    Thanks for the reply.

    I shall check out Safe Cracker - but can you do it without that Module?

    In terms of the latest news - what does dynamitc=“no” mean does that pull the latest news by author?
    The “latest-news” is general but then do I need to set up another one just for business advisers i.e. “business-advisers-lastest-news” and then pull in the news depending on author or category.

    Would the general news and business adviser news be different? Or should I mix them together and pull the business adviser news onto thier page? i.e. Amanda talks about “How is your business” and only that article sits on the Amanda’s page. Thats what I need to do.

    Sorry Im not getting it.
    Any help is greatly appreciated.

    Thanks again
    Amanda

  • #4 / Apr 04, 2012 7:54am

    Te3d

    17 posts

    Hi Amanda,

    dynamic=‘no’ means that EE is not using the URL to select the corresponding entry, it purely goes by what you have in the tag.

    To pull the “latest-news” by one author/adviser you’d use the ‘author_id’ parameter, which limits the query by the member ID of the entry’s author. This assumes that the advisers are authoring their own news items. If not, you could set up categories for the ‘latest-news’ channel and pass the ‘category’ parameter to only show a subset of ‘latest-news’ items.

    {exp:channel:entries channel="latest-news" limit="3" orderby="date" dynamic="no" author_id="1"}
     {title}
    {/exp:channel:entries}

    I hope that helps.

    Ted

  • #5 / Apr 04, 2012 9:14am

    koogarsox

    27 posts

    Hi Ted.

    Thanks for your reply.

    If I set it upp with author_id=“1” that means that the page has to be set up for the business adviser.
    This is hard to explain… LOL

    author_id=“1” - I would assume would need to be added per business adviser as the ID will change.

    I have set up the business advisers as a Template Group which uses a veiw template… Then they are added into a category depending on location:

    Find an Adviser - http://www.koogarhq.co.uk/find-an-adviser
    Choose which location - http://www.koogarhq.co.uk/find-an-adviser/cat1
    Adviser - http://www.koogarhq.co.uk/business-adviser/view/simon-heath
    (these domains will change once the site goes live)

    So how do I make the author_id change depending on which adviser page your on?

    Thanks again!
    Amanda

  • #6 / Apr 04, 2012 9:57am

    Te3d

    17 posts

    Amanda,

    So… if I’m reading this correctly, you have one template ‘view’ that displays the entry for a specific business adviser based on the URL. Each separate adviser has their own entry, correct?  I’m not sure if it’s the most streamlined solution to your problem, but you could add a field ‘adviser_auth_id’ in the adviser entry where you enter the corresponding author ID for that advisor and then pass it to the nested latest-news display.

    {exp:channel:entries channel="latest-news" limit="3" orderby="date" dynamic="no" author_id="{adviser_auth_id}"}
     {title}
    {/exp:channel:entries}

    As long as that’s nested in the main adviser entry channel entries tag, it should work.

    Ted

     

  • #7 / Apr 04, 2012 11:35am

    koogarsox

    27 posts

    Thanks Ted.

    Is there a better way of doing it? Wish we could speak over the telephone…

    I think the best wayb forward would be for me to create a seperate BA-latest-news and then use the author_id from that.

    Would this work with Safe Cracker?

    Thanks again and I appreciate all of your help!

    Kind regards
    Amanda

     

  • #8 / Apr 04, 2012 1:28pm

    glenndavisgroup

    436 posts

    Hi Amanda,

    I have a couple of questions for you:

    1) Do advisers add their own news stories to the website them selves or is it done by someone else? By someone else I mean someone with different login credentials that could be a secretary etc. the can login and do this for them.

    2) Do you currently have an advisers channel that holds each of the advisers’ info to display on their pages? If so, is the author for each entry set to that advisers’ name or is it set to someone else? You can see this if you login to the CP and edit an entry. Then click the “Options” tab in the entry screen. There you will find the “Author” dropdown. That’s the value I’m interested in.


    Thank you,

    Mike

  • #9 / Apr 06, 2012 11:39am

    Shane Eckert

    7174 posts

    Hey koogarsox,

    How are things going with this?

    Mike has some great questions concerning this. What do you think of those?

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases