News:

Wondering if this will always be free?  See why free is better.

Main Menu

Featured Posts HTML Code - Where To Insert

Started by angellionel, April 14, 2011, 12:53:57 AM

Previous topic - Next topic

angellionel

Hi all! I am wondering if the following can be done.

I have added a 'Featured Posts' banner to my main homepage, and it is working fine. What I am now wondering is if the same HTML code can be inserted into the forum index or other page to have the banner display there as well, preferably to show right under the main forum menu.

If such can be done, where in the page would it be inserted? Would I need to modify the HTML code in any way before inserting it? Would the quotation marks (") need any special handling?

Thank you for any assistance or suggestions offered!

Hj Ahmad Rasyid Hj Ismail

First, convert the html code to php code.

Second, insert that code after this code in index.template.php:

// Show the menu here, according to the menu sub template.
template_menu();

Insert the converted code here!

angellionel

Quote from: ahrasis on April 23, 2011, 01:23:18 AM
First, convert the html code to php code.

Second, insert that code after this code in index.template.php:

// Show the menu here, according to the menu sub template.
template_menu();

Insert the converted code here!


Thank you very much for the reply! That's helpful information. Much appreciated.   :)

I'm not versed on PHP coding however, but hopefully I can find some online resource to guide me in converting the code.  Thanks again for your assistance!

angellionel

I was able to convert the code.   ;D   Thank you for your suggestion!

I did insert the code at the suggested point and it works, however there is a gap that is created in the page, allowing the background color (light blue) to show (see attached image). I also tried inserting the code above the suggested line and it works there as well, but the same gap still shows. Is there something else I can do to ensure that gap in the page does not show?   :)

Thanks!

Hj Ahmad Rasyid Hj Ismail

Can you provide the index.template.php file with the code here please?

angellionel

Quote from: ahrasis on April 23, 2011, 06:34:06 AM
Can you provide the index.template.php file with the code here please?

Thanks for the quick reply! The file is attached.

Hj Ahmad Rasyid Hj Ismail

Looking at your index.template.php shows that you already have Ad Management Mod. You can use that mod to insert your html code into a position under the menu without breaking the theme.

Or you can try this. Find:
// Show the menu here, according to the menu sub template.
template_menu();

echo"<table class=\"Bordered\" align=\"center\" border=\"0\" cellpadding=\"1\" cellspacing=\"3\" width=\"1000\">
<tr><td colspan=\"6\" style=\"text-align:center;\"><span style=\"color:#0b274b;font-size:12px;\">CLICK ON AN IMAGE TO READ ABOUT AND VIEW FINDS MADE BY AMERICAN DETECTORIST MEMBERS</span></td></tr>
<tr><td><a href=\"http://www.americandetectorist.com/forum/index.php?topic=5490.0
\" target=\"_blank\"><img src=\"http://www.americandetectorist.com/amer/images/featured/post_01.jpg
\" alt=\"1929 Standing Liberty Quarter\" width=\"156px\" height=\"121px\" /></a></td>
<td><a href=\"http://www.americandetectorist.com/forum/index.php?topic=5428.0
\" target=\"_blank\"><img src=\"http://www.americandetectorist.com/amer/images/featured/post_02.jpg
\" alt=\"1853 Seated Half Dime\" width=\"156px\" height=\"121px\" /></a></td>
<td><a href=\"http://www.americandetectorist.com/forum/index.php?topic=5456.0
\" target=\"_blank\"><img src=\"http://www.americandetectorist.com/amer/images/featured/post_03.jpg
\" alt=\"1852 Large Cent\" width=\"156px\" height=\"121px\" /></a></td>
<td><a href=\"http://www.americandetectorist.com/forum/index.php?topic=5467.0
\" target=\"_blank\"><img src=\"http://www.americandetectorist.com/amer/images/featured/post_04.jpg
\" alt=\"30 Roman Coins\" width=\"156px\" height=\"121px\" /></a></td>
<td><a href=\"http://www.americandetectorist.com/forum/index.php?topic=5441.0
\" target=\"_blank\"><img src=\"http://www.americandetectorist.com/amer/images/featured/post_05.jpg
\" alt=\"11 Keepers\" width=\"156px\" height=\"121px\" /></a></td>
<td><a href=\"http://www.americandetectorist.com/forum/index.php?topic=5471.0
\" target=\"_blank\"><img src=\"http://www.americandetectorist.com/amer/images/featured/post_06.jpg
\" alt=\"1848 Large Cent\" width=\"156px\" height=\"121px\" /></a></td></tr>
</table>";

Replace with:

// Show the menu here, according to the menu sub template.
template_menu();

echo '
<div style="text-align:center;">';

echo"<table class=\"Bordered\" align=\"center\" border=\"0\" cellpadding=\"1\" cellspacing=\"3\" width=\"1000\">
<tr><td colspan=\"6\" style=\"text-align:center;\"><span style=\"color:#0b274b;font-size:12px;\">CLICK ON AN IMAGE TO READ ABOUT AND VIEW FINDS MADE BY AMERICAN DETECTORIST MEMBERS</span></td></tr>
<tr><td><a href=\"http://www.americandetectorist.com/forum/index.php?topic=5490.0
\" target=\"_blank\"><img src=\"http://www.americandetectorist.com/amer/images/featured/post_01.jpg
\" alt=\"1929 Standing Liberty Quarter\" width=\"156px\" height=\"121px\" /></a></td>
<td><a href=\"http://www.americandetectorist.com/forum/index.php?topic=5428.0
\" target=\"_blank\"><img src=\"http://www.americandetectorist.com/amer/images/featured/post_02.jpg
\" alt=\"1853 Seated Half Dime\" width=\"156px\" height=\"121px\" /></a></td>
<td><a href=\"http://www.americandetectorist.com/forum/index.php?topic=5456.0
\" target=\"_blank\"><img src=\"http://www.americandetectorist.com/amer/images/featured/post_03.jpg
\" alt=\"1852 Large Cent\" width=\"156px\" height=\"121px\" /></a></td>
<td><a href=\"http://www.americandetectorist.com/forum/index.php?topic=5467.0
\" target=\"_blank\"><img src=\"http://www.americandetectorist.com/amer/images/featured/post_04.jpg
\" alt=\"30 Roman Coins\" width=\"156px\" height=\"121px\" /></a></td>
<td><a href=\"http://www.americandetectorist.com/forum/index.php?topic=5441.0
\" target=\"_blank\"><img src=\"http://www.americandetectorist.com/amer/images/featured/post_05.jpg
\" alt=\"11 Keepers\" width=\"156px\" height=\"121px\" /></a></td>
<td><a href=\"http://www.americandetectorist.com/forum/index.php?topic=5471.0
\" target=\"_blank\"><img src=\"http://www.americandetectorist.com/amer/images/featured/post_06.jpg
\" alt=\"1848 Large Cent\" width=\"156px\" height=\"121px\" /></a></td></tr>
</table>";

echo '
<br class="clear" />
</div>';


I haven't tested this yet.

Arantor

Well, you already added an ad there, so surely, you could just add it to the area where you added the advertisement?

angellionel

Quote from: ahrasis on April 23, 2011, 11:34:21 AM
Looking at your index.template.php shows that you already have Ad Management Mod. You can use that mod to insert your html code into a position under the menu without breaking the theme.

Or you can try this. Find:


I haven't tested this yet.

Thank you ahrasis and Arantor!  I initially attempted to insert the html code into the Ad Management Mod but resulted in errors. I haven't attempted to do so with the converted code though. I'll try that to see what happens.

If that doesn't work I'll give your suggestion a try ahrasis. Thank you!

angellionel

I just tried inserting the PHP code using the Ad Management Mod but it also resulted in errors. I will try the other method to see if that works.   :)


angellionel

ahrasis, I tried your suggested code. I like that it now creates a space between the banner and the main menu. It makes it look much better.   :)  Thanks!   The theme break still shows though. I tried editing the cell spacing but it has no effect. Other than the breaking of the theme though the banner displays well.   :)

I don't' yet have it up permanently as I am still going try and see if the gap can be removed.   :laugh:

Hj Ahmad Rasyid Hj Ismail

Quote from: angellionel on April 23, 2011, 11:59:06 AM
I just tried inserting the PHP code using the Ad Management Mod but it also resulted in errors. I will try the other method to see if that works.   :)
I am sorry to hear that. I did mention html code and not php code to be inserted in ad management mod field
Quote from: ahrasis on April 23, 2011, 11:34:21 AM
You can use that mod to insert your html code into a position under the menu without breaking the theme.

Try again using ad management mod and this time use your original HTML CODE.

angellionel

Quote from: ahrasis on April 24, 2011, 01:31:53 AM
I am sorry to hear that. I did mention html code and not php code to be inserted in ad management mod field.

No, that was my error. I tried the PHP code because the initial attempt to insert the html code via the mod resulted in errors. I must have missed something while copying and pasting.

Quote from: ahrasis on April 24, 2011, 01:31:53 AM
Try again using ad management mod and this time use your original HTML CODE.

I again tried inserting the html code via the mod and it does work, but the same break in the theme still shows. I also reduced the size of the images within each cell to see if that would eliminate the break, but there was no difference. Other than that theme page break though the banner shows up nicely. I just don't particularly like that break in the theme; it makes the page look unseemly.   lol

Thank you for all your help ahrasis. I very much appreciate it.

Hj Ahmad Rasyid Hj Ismail

Try to remove "table" in both opening and closing and see how it goes.

angellionel

Quote from: ahrasis on April 24, 2011, 11:16:07 AM
Try to remove "table" in both opening and closing and see how it goes.

Unfortunately that didn't work either.   :-\  Following up on the suggestion to use Ad Management, I uninstalled the old version and installed the latest one. Adding the html code now works without causing the page break.   ;D   Hopefully that will remain so.   lol

Thank you for your patience and great assistance, ahrasis!!

Hj Ahmad Rasyid Hj Ismail

No problem. Glad to be here.  ;) And always remember to use the latest mod version since it might have removed some of the old bugs like yours.  :)

Advertisement: