Jump to content

[Service] CMS - Simple ad plugin


Hisashi

Recommended Posts

Hello,

I have a comic book reader, I want to make every 'x' amount of images display an ad.

These are the field settings:

Quote

Could contain: Text, File, Webpage

Could contain: File, Menu, Text, Webpage

Could contain: Text, File, Webpage

 

Code:

{{if $formValue}}
<div class="ipsGrid ipsGrid_collapsePhone ipsType_center">
{{foreach $value as $file}}
	<img data-src="{file='$file' extension='cms_Records'}" loading="lazy" class="ipsImage ImgMargem" alt="{$record->_title} by {$record->customFieldDisplayByKey('artista_manga', 'raw')}"><br>
{{endforeach}}
</div>
{{endif}}


Result:

Quote

Could contain: Text, Page, Number, Symbol

 

Could contain: Oars, Text

Let's say I uploaded 30 images. I want to make the ad appear every '5' images. 

------

I could do something like this, but this is not the correct way, as the ad is repeated for each image.

Quote

Screenshot_333.thumb.png.ac12d9befccf8f1da995ba66dc6a787c.png

Could contain: Text, Page, Label, Number, Symbol

 

What needs to be done?

As I showed in the last image, may not even need a plugin, just a code that prevents repeated and set a value. (I can pay for that information too).

If a plugin is really needed, it just needs to have the following functions.

Could contain: Monitor, Display, Screen, Electronics, LCD Screen

 

Send me a private message if interested.

Edited by Hisashi
Link to comment

Untested in Pages...

{{if $formValue}}
<div class="ipsGrid ipsGrid_collapsePhone ipsType_center">
{{$test = 0;}}
{{foreach $value as $file}}
	<img data-src="{file='$file' extension='cms_Records'}" loading="lazy" class="ipsImage ImgMargem" alt="{$record->_title} by {$record->customFieldDisplayByKey('artista_manga', 'raw')}"><br>
        {{$test++;}}
        {{if $test % 5 == 0}}
       <YOUR AD STUFF>
       {{endif}}
{{endforeach}}
</div>
{{endif}}

 

Link to comment
6 minutes ago, Nathan Explosion said:

Untested in Pages...

{{if $formValue}}
<div class="ipsGrid ipsGrid_collapsePhone ipsType_center">
{{$test = 0;}}
{{foreach $value as $file}}
	<img data-src="{file='$file' extension='cms_Records'}" loading="lazy" class="ipsImage ImgMargem" alt="{$record->_title} by {$record->customFieldDisplayByKey('artista_manga', 'raw')}"><br>
        {{$test++;}}
        {{if $test % 5 == 0}}
       <YOUR AD STUFF>
       {{endif}}
{{endforeach}}
</div>
{{endif}}

 


INCREDIBLE!! Worked perfectly.

Could contain: Text, Page, File

Link to comment
  • Recently Browsing   0 members

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