Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

DiscussionGrid

edited September 2006 in Vanilla 1.0 Help
Is there a method of adding something to the top of the DiscussionGrid? I believe thats where I want to add something, if I'm not mistaken.

Comments

  • Options
    MarkMark Vanilla Staff
    There are lots of ways.
    What exactly do you want to add?
  • Options
    Mark,

    I was looking to include my Adsense javascript code in that area, at least on the discussions and categories section. I was digging through the code a bit tonight and thought the DiscussionGrid might be the area I'm looking for, instead of adding it directly to Side Panel. I'm already implementing the Adsense code in the Panel, but I thought having it right above the Discussions, it may be more targeted and effective.

    Any help would be much appreciated.
  • Options
    MarkMark Vanilla Staff
    Well, you can:

    a) create a control and add it to the page above the discussions - similar to my lussumobanner code (see the suggestions tab) but use the CONTROL_POSITION_BODY instead of CONTROL_POSITION_HEAD.
    b) attach to the prerender delegate of the discussion grid and throw your content in there.
    c) create a new theme and change the discussions.php template to include your code

    I'd recommend the first option and try to stay away from the third. Themes are useful, but it's always better to try to stick with the default theme so you don't miss out on changes in future revisions.
  • Options
    Thanks Mark for the help. I tried that, but I don't think I did it properly. I received the following area. What does that mean exactly?

    Notice: Undefined index: CONTROL_POSITION_BODY in /home/content/j/p/m/jpmitchell7/html/extensions/AdsenseCode/default.php on line 41

    I'm not sure how to format CSS stylesheet for this, so could that be a reason why its not working right?
  • Options
    MarkMark Vanilla Staff
    Darnit. Sorry, that's my mistake. It's CONTROL_POSITION_BODY_ITEM, not CONTROL_POSITION_BODY.
  • Options
    Okay, I'll try that when I get home tonight. I did it the old fashion way for now, by echo'ing the javscript adcode where need be. So basically I am using step 3 right now. I'd like an easier way to do in the future with an extension. I'll have to play around with it later, thanks for the help.
  • Options
    Mark,

    Thank you very much. That worked like a charm and made it work perfectly. Soon, I'll have an extension available for download that allows for a banner to be displayed at the top of the main body. Now, the only other thing that I'd like to add to this extension is an Adsense banner directly above the Add Your Comments. I currently tweaked this for my Vanilla forum through the comments.php file in theme. I know this isn't the best way to do it.

    What method should I use to echo a piece of javascript in that region?

    Thanks for your help so far.
  • Options
    this is exactly the type of extension that I have been looking for too. Can you post the extension once you have it finished?
  • Options
    I've posted it over here:

    http://lussumo.com/community/discussion/2715/advert-addon/#Item_4

    I plan to improve it, of course. :-)
  • Options
    edited September 2006
    Hey Mark that CONTROL_POSITION_BODY_ITEM worked great but it puts it at the bottom of dicussions is there a way to move it to the top ? (top being above the discussions not top of page ;-)
    Ok I figured out how to do it but need some tricky moving advice, I want to move it above the header but not at the top of the page if that makes any sense ;-)
    ie
    - > top of page where lussumo banner usually would go
    - > here is where I want the banner to go < - (just above the header)
    - > header tab links
    - > discussion grid top
  • Options
    i'd appreciate if someone post an example
  • Options
    Hmm..i like it
Sign In or Register to comment.