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.

Multiple authors/blogs, one SAEF

August 14, 2010 3:41pm

Subscribe [3]
  • #1 / Aug 14, 2010 3:41pm

    kstatham

    52 posts

    I’m sure this has been done before, but I can’t figure it out. I’m working on a news site, and it’s going to have several columnists, each with their own blog and categories, but using the same field group.

    So, I want to use one SAEF form, and dynamically set the weblog for that form based on the logged in user. I tried assigning variables like below, but it’s not working:

    {if member_id == '4'}{assign_variable:column_name="columnist_name1"}{/if}
    {if member_id == '5'}{assign_variable:column_name="columnist_name2"}{/if}

    This variable would be used as segment_3 in a link to the SAEF from the columnist’s profile page like so (group 6 is columnists):

    <a href="/index.php/columnists/new_article/{column_name}">Write a new entry for your column</a>

    And the form would use {column_name} as the weblog for that user.

    The conditionals aren’t working and I found on the forums that this is a parsing issue; no matter who is logged in, it will also set the variable to be for the first member_id in the list of conditionals.

    Is there a better way to approach this?

    Thanks for any help!

    Ken

  • #2 / Aug 14, 2010 10:39pm

    kstatham

    52 posts

    I figured out how to do this… still wondering if I’m making this more complicated than it needs to be, but it’s working fine for now. I created a new custom profile field called “slug” that will be entered by super admins when registering new columnists. This field will hold the short name of that columnist’s blog. So new link to add articles looks like this:

    <a href="/index.php/columnists/new_article/{exp:user:stats}{columnist_slug}{/exp:user:stats}">Write a new entry for your column</a>

    Hope this is helpful to somebody else.

  • #3 / Aug 15, 2010 4:21pm

    Greg Salt

    3988 posts

    Hi kstatham,

    Are you sure that this is working for all users? Have you checked the documentation for the Custom Profile Data tag?

    Cheers

    Greg

  • #4 / Aug 16, 2010 5:42pm

    kstatham

    52 posts

    Hi Greg,

    It’s working for members of the Columnists group, and it requires some setup for each new columnist, but yes, it’s working. Here is how I’m currently doing it:

    1. Setup new category and channel for new columnist.
    2. Register new columnist to Columnists group, and assign their slug custom profile field (same as channel short name) and category.
    3. Assign Gypsy field(s) to new channel
    4. Give Columnists member group access to new channel

    That’s it, and it seems to be working.

    Is there something I should be checking that I’m overlooking that might not be working? The custom profile data tag looks similar to what the User module offers, but native to EE. I didn’t know about that, so that’s good to know, but I’m not sure what specifically I’m supposed to be looking for in those docs that could potentially point out any problems.

    Thanks for your help!
    Ken

  • #5 / Aug 17, 2010 2:10am

    John Henry Donovan

    12339 posts

    Ken,

    Glad this is working for you and thank you for the write-up as other users will find this useful no doubt. Feel free to start a new thread if you have any more questions.

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

ExpressionEngine News!

#eecms, #events, #releases