DeeEmm

Pragmatism in code

Waxing lyrical about life the universe and everything software related since lunchtime 2006.

Dolphin 6 - Add / Move Advertising Banner To Block

If you would like to utilise the inbuilt banner manager in Dolphin, you are stuck with the locations lais out in the templates. Sure you can move the banners to another position within the template files, but what about if you wanted the advert to appear in it's own block? Well, here's how...

To add the banners to a block you will need to add a PHP block - to to this simply drag one into the desired position in the page builder in the admin panel. I've added one to the left column on the homepage. Rename it with something meaningfull - i named mine 'advertisement' :D

Now here's the tricky part... You will need to directly edit the database to be able to add your PHP code. I personally use phpMyAdmin, but there are many other database editors out there.

So fire up your favourite database tool and go to the 'PageCompose' table and search / browse for your newly added block.

Now add the following PHP code to the 'Content' field

echo banner_put_nv(2);

(the number 2 relates to the left block - 1, 3 and 4 relate to the top, right and bottom blocks repsectively)

If you are using the borderless block mod - you will also need to wrap this in a div and give it a height as it will overlap the content below it.

Now, once you've entered this- go back to the admin panel and move your newly created block to another position - and then move it back to the desired position. This clears the cache - if you don't do this - your new block will not display. Now navigate to your homepage and check out your new banner ads in a block.

With your banners now displayed in a block you might want to go and comment out the old banner calls in the template - these can be found in _header.html and _footer.html. To remove the left banner, open _header.html and look for the following tag

__banner_left__

either delete it or comment it out to prevent the banner from appearing in the standard position.

DM

Mac Database Client
DOLPHIN - Create Custom Blocks
 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Guest
Wednesday, 20 September 2017
If you'd like to register, please fill in the username, password and name fields.

Captcha Image