Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 2:
if statement or other?

 

 


dimeco
User

Oct 23, 2009, 7:27 AM

Post #1 of 8 (3944 views)
Shortcut
if statement or other? Can't Post

As per my other post re: featured authors, I was wondering the best way to go about this thought:

The featured authors are by topic, so making a template "just for those featured authors" probably wouldn't work, unless I did it specifically by topic.

I was thinking though, I'd kind of like these featured authors to have a special template, i.e., one that either removes ads that I typically have on all other pages, OR has only "their" ads on it.

I guess my question is, if I made a custom template for these authors, how would I make it work?

i.e., just set up a "business featured" category, (but then its yet another category lol) - or would I set up a custom template per author? (and then how would I activate it)?

Also - Author Bio's... is there a way to do author bio pages that are *ONLY* those who are featured?

Sorry for the questions... making updates to our site :)

Amber


Donna
Staff / Moderator


Oct 23, 2009, 4:06 PM

Post #2 of 8 (3936 views)
Shortcut
Re: [dimeco] if statement or other? [In reply to] Can't Post

What about setting up a templateIf?

I'm assuming all of your guest users are using the same login, so the same user number. With that, you could do something like, "If this article is NOT published by this user number, do this." and then a second templateIf that said "If this article IS published by this user number, do this."

Would something like that work for you? You'd still be using the same template, but you could code is so the ads only showed up if the user number matched your guest login number.

Donna

--
support@interactivetools.com


dimeco
User

Oct 25, 2009, 1:19 PM

Post #3 of 8 (3924 views)
Shortcut
Re: [Donna] if statement or other? [In reply to] Can't Post

Hmm... that could quite possibly work.

What about a "templateIF" statement then that could be made for each author? i.e., If guest (say author #3), show the template (which has general/public ads).

"if" author #4, show template X (which has ads exclusively from author 4?)

If that would work, it would be fantastic.

Next question... um... how would I set it up? LOL - If Statements and I haven't been the best of friends Crazy

Amber


Donna
Staff / Moderator


Oct 26, 2009, 1:30 PM

Post #4 of 8 (3903 views)
Shortcut
Re: [dimeco] if statement or other? [In reply to] Can't Post

It would all be on one template, as a templateIf will just allow you to display specific code -- probably the easiest method to do it would be to just templateIf the ads themselves. So, you'd have something like this:

<!-- templateIf : $article.createdByUserNum$ == "4" -->
Advertising code for user 4
<!-- /templateIf -->


<!-- templateIf : $article.createdByUserNum$ == "5" -->
Advertising code for user 5
<!-- /templateIf -->

...and so on and so forth.

The rest of your template code would display as usual, there's no point in duplicating all of that as well. Only the parts that were different would be separated out into templateIf's.

Does that make sense?

Donna

--
support@interactivetools.com


dimeco
User

Oct 26, 2009, 1:49 PM

Post #5 of 8 (3902 views)
Shortcut
Re: [Donna] if statement or other? [In reply to] Can't Post

Hi Donna,

Yes it makes total sense. The only question I'm thinking now, is having this templateIF statement...

if I have say 20 authors... do I have to put 20 templateIF statements in the code?

If so... that will make it too huge for my liking :(

Amber


Donna
Staff / Moderator


Oct 26, 2009, 4:35 PM

Post #6 of 8 (3895 views)
Shortcut
Re: [dimeco] if statement or other? [In reply to] Can't Post

Yup. Unfortunately, that's the biggest downside. If you only had two sets of ads (ie, "guest authors" or "not guests") it'd be easy enough, but if you want different ads for each author, that gets more complicated.

The only other method I can think of that would work would be different categories for different authors. Then you could just setup a publish rule for each category.

Hmm, actually here's a thought: What if the "primary" category was based on author, and then your topic categories were the "secondary" categories? You can assign an article to more than one category, but Article Manager will always use the "primary" category as the one it uses for publish rules, etc.

That way, you could create a new publish rule for each author category, and setup the ads individually that way. It would be a bit of a pain to add a new author, but I think if you want custom ads by author it's going to be a pain no matter how you set it up.

Donna

--
support@interactivetools.com


dimeco
User

Oct 26, 2009, 4:44 PM

Post #7 of 8 (3894 views)
Shortcut
Re: [Donna] if statement or other? [In reply to] Can't Post

You know what? This could actually work.

From an ad perspective that's not "too" big of a deal, because my ad software/script can be set for keywords, which I could use say the author's name as the keyword, OR...

Hmm.

Okay - this might work. I might switch the categories to "featured" - and that will become the main templates.

Thanks!

Amber


Donna
Staff / Moderator


Oct 26, 2009, 5:35 PM

Post #8 of 8 (3891 views)
Shortcut
Re: [dimeco] if statement or other? [In reply to] Can't Post

Glad to help! Hope some of my ideas work for you, or at least push you in the right direction. :)

Donna

--
support@interactivetools.com