Intechnic
Users Developers
Home / Forums / In-Portal CMS / General In-Portal Discussions / Custom template for category and banners / Topic Posts

In-Portal Forum

This is a place for users of In-Portal to ask questions, discuss various topics, and interact with other members of the In-Portal Community. Please report bugs through the Bugs Team (not the Forum). If you are interested in contributing or joining one of the many Teams for In-Portal, please check out the Contribute section of the website.
 

In-Portal Forum

Custom template for category and banners (30)


Posted: 11/08/2004 6:26:12 AM

Reply Quoted  


Is it possible to create a custom template for a category, like in the previous version?
This would be to insert bannercode targeted for a category.

Ofcourse I hope you are developping a bannermodule :D

Posted: 11/08/2004 3:43:58 PM

Reply Quoted  


Hi Gerard,

Yes, we are planning a module for banner ads, a little later once the main three modules are stabilized.

I will get back to you shortly about the cusotm category tempaltes.

Posted: 11/08/2004 6:57:01 PM

Reply Quoted  


Hello gerard,

In regards of custom templates for categories. As you must know, the default category item template "default/category/item_template.tpl" has the following code/tag which returns the category link

<A href="<inp:cat _field="link" />"><inp:cat _Field="Name" /></a>



In order to have a custom category template automatically built-in instead of the default one you'll have to make some template changes.

First, you need to create a category custom field called "indextemplate" and store whichever template name you plan to use in that field. For example, you create a custom template 1.tpl and store it in "indextemplate" category custom field as "1.tpl". The template should be placed under "themes/default/" folder. Of course you can create subfilders and store your custom templates there.

Second, change the above code to this:

<A href="<inp:cat _field="customlink" />"><inp:cat _Field="Name" /></a>



This should for for you just fine.

Thank you.

Posted: 11/09/2004 2:27:20 AM

Reply Quoted  


Thank you I will try it

Gerard

Posted: 04/16/2005 6:51:03 AM

Reply Quoted  


Any news on when the banner module will be available.

If its a while off i will take the time to devlop my own - if its around the corner ....................well l think I'll wait

Brinley

Posted: 04/16/2005 2:08:04 PM

Reply Quoted  


miura wrote:04/16/2005 6:51:03 AM
Any news on when the banner module will be available.

If its a while off i will take the time to devlop my own - if its around the corner ....................well l think I'll wait

Brinley


Hello Brinley,

I am afraid it will take awhile before we get it out of the door. Next Module will be In-commerce.

Thanks.

Posted: 04/17/2005 12:53:16 PM

Reply Quoted  


Hi Dmitry!

I know this is nto really something i should be asking of you so if you choose not to reply - no probs!

Basically I have installed a banner ad system called phpAdsnew and i need to add the below code into pagetop but it doesnt seem to be able to retrieve the include:

<?php
if (@include(getenv('DOCUMENT_ROOT').'/banners/phpAdsNew/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('', 2, '', '', '0', $phpAds_context);
echo $phpAds_raw['html'];
}
?>

I have added the above code into the body of a blank php page and it works fine - so i thought i would ask if you can tell me how to get it to work in the pagetop.tpl.


ps: if you are going to be producing a Banner module i suggest you have a look at this program and copy a lot of its functionality as it is unbelievable and does pretty much everything other than send you a birthday card .

[URL href="http://phpadsnew.com"]http://phpadsnew.com[/URL]

There is also a pro version on sourceforge but i havent had a look at that yet as i intend to use ur banner module eventually

Cheers
Brinley

[Edited By miura on 04/18/05 2:41:31 PM]

Posted: 04/18/2005 3:24:51 PM

Reply Quoted  


miura wrote:04/17/2005 12:53:16 PM
Hi Dmitry!

I know this is nto really something i should be asking of you so if you choose not to reply - no probs!

Basically I have installed a banner ad system called phpAdsnew and i need to add the below code into pagetop but it doesnt seem to be able to retrieve the include:

<?php
if (@include(getenv('DOCUMENT_ROOT').'/banners/phpAdsNew/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('', 2, '', '', '0', $phpAds_context);
echo $phpAds_raw['html'];
}
?>

I have added the above code into the body of a blank php page and it works fine - so i thought i would ask if you can tell me how to get it to work in the pagetop.tpl.


ps: if you are going to be producing a Banner module i suggest you have a look at this program and copy a lot of its functionality as it is unbelievable and does pretty much everything other than send you a birthday card .

[URL href="http://phpadsnew.com"]http://phpadsnew.com[/URL]

There is also a pro version on sourceforge but i havent had a look at that yet as i intend to use ur banner module eventually

Cheers
Brinley

[Edited By miura on 04/18/05 2:41:31 PM]


Hello Brinley,

I have bad and good news about adding this code to your templates. The bad news - currently In-portal doesn't support PHP code in it's templates. The good news - you can create a new tag in In-portal and include what ever you need from phpAdsNew system so it can be output to your templates. Please give me a few days before I get back to you on this. Plus, I am sure you'll be busy with upgrading to a latest release at least for sometime :D.

In regards to Banner Module and phpAdsNew banner system, we've done a lot of integration within our previous In-link2 system. We'll certainly do a big research on this kind of systems first.

Thanks.

Posted: 04/19/2005 2:24:26 AM

Reply Quoted  


Hi Dmitry

Thanks for the info on adding php to tpl's - i look forward to your response on how to create tags to poulate templates (eeeeeek!)

Also thanks for the heads up on the new upgrade - andyou are righ, I'll be busy with that for a while

Have a good one.

Cheers
Brinley

Posted: 04/21/2005 10:35:02 AM

Reply Quoted  


miura wrote:04/19/2005 2:24:26 AM
Hi Dmitry

Thanks for the info on adding php to tpl's - i look forward to your response on how to create tags to poulate templates (eeeeeek!)

Also thanks for the heads up on the new upgrade - andyou are righ, I'll be busy with that for a while

Have a good one.

Cheers
Brinley


Hello,

Be very careful with what you changing and add some comments around the code.

Open "kernel/parser.php" and add the following function in the end of the file before "?>":

function m_include_banner($attribs = array())
{
//     $zone = getArrayValue($attribs,'_zone');

     if @include(getenv('DOCUMENT_ROOT').'/banners/phpAdsNew/phpadsnew.inc.php'))
     {
         if !isset($phpAds_context))
             $phpAds_context = array();
             
         $phpAds_raw = view_raw '', 2, '', '', '0', $phpAds_context);        
         $ret = $phpAds_raw['html'];        
     }
     
     return $ret;
}



Don't forget to specify correct path to your phpAdsNew system. The new tag name is <inp:m_include_banner />, which can be called from any other template. Aslo, you can pass it additional attribute, i.e. <inp:m_include_banner _Zone="1" />, but make sure to adjust the function first.

Thanks.


[Edited By Dmitry on 04/21/05 10:38:18 AM]

Page:  1 2 3