Forums / General Questions / Ads on a page

Ads on a page

Views: 1,725

Results 1 to 20 of 28
1 Dec 2011, 11:43 PM
#1
slater555 avatar

slater555

Zen Follower

Join Date:
Jan 2011
Posts:
367
Plugin Contributions:
0

Ads on a page

I can add text at top of page by using <Categories/Products> and clicking edit next to a category... How can I ad text to the bottom of the page (unique to only one category)

2 Dec 2011, 1:06 AM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Ads on a page

Look at swguy's boilerplate file tips mentioned in numerous threads. You may want the "extra boilerplate" adaptation of that that I have done - there is info in the threads where it is discussed.
One basic version is in Boilerplate mod- separate it from description?, post 20.
The final version is posted in How to Add Content Below category listings?, post 5.

2 Dec 2011, 2:26 AM
#3
slater555 avatar

slater555

Zen Follower

Join Date:
Jan 2011
Posts:
367
Plugin Contributions:
0

Re: Ads on a page

not any help, one needs to be clicked on and ends up on top with the category description and the other one the links to see it in action don't work (I guess no longer on the web)

2 Dec 2011, 3:41 AM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Ads on a page

What do you mean, not any help? The specific posts I pointed to are not the ones you are describing.
The Boilerplate... post 20 code is given for use in the product info page, but its essence can easily be put wherever you want in the category listing or product listing page. It is simple and appropriate for limited use as you described (if you meant only one category needs it).

The Extra Boilerplate will function the same for category descriptions as for product descriptions, with appropriate variable substitution as described in the post. It is suitable for widespread use in multiple categories or products.

The Short Description mod has been regularly used (though I haven't looked at it myself), and its support thread should be able to answer any questions you have.

2 Dec 2011, 4:02 AM
#5
slater555 avatar

slater555

Zen Follower

Join Date:
Jan 2011
Posts:
367
Plugin Contributions:
0

Re: Ads on a page

Sorry, let me explain, I tried the second one (#5) and it was not what I wanted. the first one (#20) had no place to see it's effect, so I dont know if it is what I want. It is too much effort to load a whole mod unless I know it is what I am looking for.. I have done that before and the actual mod was not at all what I was looking for and I just don't want to add something I'm not sure is it. Any idea where I might see it online?
also it says it is for 1.3.7 and may or may not work on 1.3.9

2 Dec 2011, 5:06 AM
#7
slater555 avatar

slater555

Zen Follower

Join Date:
Jan 2011
Posts:
367
Plugin Contributions:
0

Re: Ads on a page

the one that is #5 puts a link at the top of the page for <more info> and when clicked displays the text right there... I want the text to appear at the bottom, or in a static ad that appears only on one page. I have a vendor who wants an ad to appear on only one page but I do not want it at the top, and I dont want the ad to be on every page as it is slightly large and they are only paying $50 per month. Right now the ad is at http://www.airtightsecurityplus.com/dvr-system.html which is not in my shopping cart but on a gateway page (ad is on right at bottom labeled <Airtight Ads>

2 Dec 2011, 5:41 AM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Ads on a page

The Short Description mod is not linked in post 5 of the thread, but post 9. I believe it is supposed to give a <more info> type link, so would probably not be suitable. The Extra Boilerplate mod in post 5 can do exactly what you want, but may be a bit more complex than needed.

Since you only want this for one location, the post 20 code will do the job effectively. Paste this snippet in your file, and make a new define file, and it will just work.```php

<?php if ($current_category_id == 34) {//replace 34 with your category id echo '<div class="advert">' . ADVERT_1 . '</div>'; } ?>

/includes/languages/english/extra_definitions/advert_defines.phpphp

<?php define('ADVERT_1','the HTML for the advertisement'); ?>

The file to put the output code in will depend on exactly what kind of page it is - category listing or product listing.
6 Dec 2011, 3:58 AM
#9
slater555 avatar

slater555

Zen Follower

Join Date:
Jan 2011
Posts:
367
Plugin Contributions:
0

Re: Ads on a page

Thanks, sorry for the delay, was on a business trip. Which file do I put the 'snippet' in?

6 Dec 2011, 4:27 AM
#11
slater555 avatar

slater555

Zen Follower

Join Date:
Jan 2011
Posts:
367
Plugin Contributions:
0

Re: Ads on a page

a category

6 Dec 2011, 5:07 AM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Ads on a page

Then you would probably want to add the snippet to /includes/templates/your_template/templates/tpl_index_categories.php near the bottom:```

<?php $show_display_category->MoveNext(); } // !EOF ?>

<?php if ($current_category_id == 34) {//replace 34 with your category id echo '<div class="advert">' . ADVERT_1 . '</div>'; } ?>

</div> ```
6 Dec 2011, 5:36 AM
#13
slater555 avatar

slater555

Zen Follower

Join Date:
Jan 2011
Posts:
367
Plugin Contributions:
0

Re: Ads on a page

thanks, i'll give it a try first thing tomorrow

6 Dec 2011, 5:16 PM
#14
slater555 avatar

slater555

Zen Follower

Join Date:
Jan 2011
Posts:
367
Plugin Contributions:
0

Re: Ads on a page

perhaps I did something wrong but when i edited the first file and added the second file my site disapeared completely. I put it back and the site came back. ???

7 Dec 2011, 8:44 AM
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Ads on a page

Yes, obviously you made some PHP error. We can't tell what it was without seeing exactly what you did, though. Can you copy & paste the area for a few lines around the edited file section?

7 Dec 2011, 5:53 PM
#16
slater555 avatar

slater555

Zen Follower

Join Date:
Jan 2011
Posts:
367
Plugin Contributions:
0

Re: Ads on a page

under /includes/languages/english/extra_definitions I added a file
advert_defines.php and this is the copy

<?php define('ADVERT_1','<table width="100%" border="1" bgcolor="#99d1d1" style="color: #000000"> <tr> <td align="center"></td> </tr></table> <tr><td> DVR Recorders<br />Are you looking for the best and most reliable <a href="http://direct.tesco.com/q/N.2001329/Nr.99.aspx" target="_blank"><b>DVD recorders</a></b>? Here at Airtight Security Plus, you will find a wide array of selection for you. You get the freedom to choose from these great items. All the items featured in this page are made with the highest quality thus ensuring customer satisfaction. Make sure to read the complete details and specifications of the items so that you'll be able to choose the best one. Digital Video Recorders are the new age video recording system. With internet ready recorders, motion sensing recording, and lengthy recording times, you can view the output live anywhere in the world with the internet '); ?>

and under includes/templates/template_default/templates (I also tried this under includes/templates/my_own_template/templates and includes/templates/bask_black/templates) I added the following

<?php /** * display the New Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?> <?php } ?> <?php if ($current_category_id == 13) {//replace 34 with your category id echo '<div class="advert">' . ADVERT_1 . '</div>'; } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_UPCOMING') { ?> <?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); ?><?php } ?> <?php $show_display_category->MoveNext(); } // !EOF ?> </div>

using current_category_id == 13

the file existed under template_default but I had to copy and paste the file to the other 2 locations when I tried it there cause it was not already under those (my_own_template and bask_black)

7 Dec 2011, 6:02 PM
#17
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Ads on a page

I don't see any stray single quotes in your define (which would cause an error), but I do notice bad HTML: You open a table, then close it, then open <tr> and <td>, then give your content, and don't even close the table row or cell let alone the nonexistent table. That needs to be fixed, though it doesn't seem likely that it could wipe out your whole page.

Have you tried putting just the define file in place? If that causes a problem, the source is narrowed down.

Any file you edit should be copied from /template_default/ into the same /your_template/ folder structure, then edited. Never change the /template_default/ version.

7 Dec 2011, 6:11 PM
#18
slater555 avatar

slater555

Zen Follower

Join Date:
Jan 2011
Posts:
367
Plugin Contributions:
0

Re: Ads on a page

alright I did find a mistake I made... I added the file to

includes/templates/my_own_template/templates

and was supposed to add it to

includes/templates/my_own_template

I have fixed that and the page does not disappear now but I see no change or text, I will see if I can work on the html

7 Dec 2011, 6:36 PM
#19
slater555 avatar

slater555

Zen Follower

Join Date:
Jan 2011
Posts:
367
Plugin Contributions:
0

Re: Ads on a page

site keeps disappearing when I do any of this

7 Dec 2011, 7:24 PM
#20
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Ads on a page

What file did you add to /includes/templates/my_own_template/ ?
There are no files you would be working with that would go there; they would go in /my_own_template/templates/ or /my_own_template/common/ or another subfolder, assuming they belong under /includes/templates/ at all and not under /includes/modules/ or /includes/languages/, etc.