Jump to content

Add a Block or Advertisement In Article


Go to solution Solved by Jim M,

Recommended Posts

Can a block or Advertisement be added to a database entry, like an article, by inserting it into HTML? I can insert a google adsense script into html and it works, but I would rather insert a block or reference an Ad that I've set up directly in Invision. {block="my_block_key"} or {advertisement="KEY"}.  Inserting these into the Source HTML editor does not work.  Is there a way to make this work, or is there not an easy way to do in-content ads or embeds?

Seems, that since this is a pretty standard use case, there has to be an easier way to do it than inserting the whole google script at each location, in each article.  

What would be even better, for a future feature, is to give the option to add advertisements to article content, not just forums. 

Link to comment
Share on other sites

  • Solution

Template code cannot be inserted into the HTML editor, it has to be specifically in our PHTML templates (Pages templates, blocks, theme templates, etc...) to execute that. 

Theoretically, I suppose, you could create a custom PHP block with your advertisement custom location template code in it and then use the external embed code in your article. 

Here a guide on using blocks "externally", it will generate a Javascript code and HTML for you to embed where you want it:

 

Alternatively, an approach which is a little more rigid but would automatically insert it into your articles, would be to include it in your Pages template for records.

 

For something easier, I would suggest making your suggestion in our Feature Suggestion forum.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...