Jump to content

Display Google Ad after second displayed article in Pages


LDDG

Recommended Posts

Hello all,

I am currently using IP.Content (Pages) to display a list of records from a database using the 2 Column Image Feature template. I am trying to figure out how to always make the second record being displayed to be a Google Ad.

I have already created a new template called entryGoogleAd. That template will be called when the second record should be displayed.

Here is the code that currently displays all records using the entry template:

<section class='ipsType_normal ipsSpacer_both'>
	{{if count($articles)}}
		{{foreach $articles as $id => $record}}
				{{if $id % 2 == 0}}
					<div class='ipsGrid ipsGrid_collapsePhone'>
				{{endif}}
				{template="entry" app="cms" location="database" group="category_2_column_image_feature" params="$record, $database, $id"}
				{{if $id % 2 == 1}}
					</div>
				{{endif}}
		{{endforeach}}
	{{endif}}
</section>

My gut feeling is that somewhere in the code above, the code 

{template="entryGoogleAd" app="cms" location="database" group="category_2_column_image_feature" params="$record, $database, $id"}

would need to be added.

How can I edite the code so that it uses entryGoogleAd on the second record being displayed?

Thanks in advance!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...