1. Using Custom to display and customize your site

Using Custom to display and customize your site

  |   17
Using Custom to display and customize your site
I have a lot of PM and email how to customize the DLE website to make it look different than the normal looks in general for example in this main page using "TBI" theme...the simple answer is using {custom} page to show only and any category

Here is step how to do this...

1) hide the {content} in main page by using this in main.tpl
[not-aviable=main]{content}[/not-aviable]


2) use include file in main.tpl like this...
{include file="custom_movies.tpl"}


3) create the .tpl file in theme folder, let call it "custom_movies.tpl" like example above...now in custom_movies.tpl, you should add the code like this
[aviable=main]
{custom category="1" template="shortstory" aviable="global" from="0" limit="10" cache="no"}
[/aviable]


- specify the category you want to show, it must be number, check in admin area for category numbers, if you want multiple categories you just use comma like "1,2,5,10"
- specify the file to show the article, in example above I use shortstory.tpl so I use template="shortstory", make sure you use the right name without extension and the file must be .tpl extension
- specify how many articles you want to show, in example I use 10, you can specify as many as you want...

Other than that just use global value...global value is good in case of you specify big number of limit="xx", in some case if you specify limit="10" but you only set global to show article in main page only 5 or any other values you have set in admin area will apply to global

in this site as you see in main page in "tbi" theme...here is the example of the code...
I have 4 main categories here so I make 4 custom files because i want to put links at the bottom to link to each individual category

{include file="custom_theme.tpl"}
{include file="custom_version.tpl"}
{include file="custom_module.tpl"}
{include file="custom_hack.tpl"}
[not-aviable=main]
{content}
[/not-aviable]


Also the include files for short story, I don't use default shortstory.tpl, in fact I make different shortstory file and name is custom_short, so for instant example inside custom_theme.tpl I include code like this

[aviable=main]
<div class="midblock">
<div class="dtop">&nbsp;</div>
&#123;custom category="3" template="custom_short" aviable="global" from="0" limit="2" cache="no"}
<div class="clr"></div>
<div class="allviewcat"><a href="/themes/">View all Themes</a></div>
<div class="dbtm">&nbsp;</div>
</div>
[/aviable]


You will see that [aviable=main], this will force it to show only in main, and category="3" because the Themes category id is "3" and I only limit to show only 2 because we don't have many posts at this moment...

Please vote if you like it and leave your comments, and your question is always welcome, we will do everything trying to get you any helps you need solutions...

Enjoy smile
Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.

Details

+25

Is this article help you customize your website?

Yes, absolutely - 12 (75%)
75%
No, because I still don't understand what is it about - 2 (12.5%)
12.5%
No, but I understand the article content well - 0 (0%)
0%
Somewhat help me... - 2 (12.5%)
12.5%


Comments 17

tbenmcp
tbenmcp
DLE TEAM
Commented By tbenmcp on July 26, 2011 (8:50 pm)
If you have any questions and need helps on your website, we (me and i-386) will try our best to help you customize your sites, if any members know any tricks or trip please help each others....
20 150Forum topics : 11Forum replies : 248Forum likes : 32

"A True Friend is Someone Who Sees the Pain in Your Eyes while Everyone Else Believes the Smile on Your Face"
Let me Google for you!
i386
i386
DLE TEAM
Commented By i386 on July 27, 2011 (7:57 pm)
nice article bro, wondering when will you post this...
4 4Forum topics : 1Forum replies : 5Forum likes : 4
tbenmcp
tbenmcp
DLE TEAM
Commented By tbenmcp on August 8, 2011 (4:52 pm)
good works brother...
20 150Forum topics : 11Forum replies : 248Forum likes : 32

"A True Friend is Someone Who Sees the Pain in Your Eyes while Everyone Else Believes the Smile on Your Face"
Let me Google for you!
Gozan
Gozan
V.I.P.
Commented By Gozan on August 21, 2011 (9:02 am)
thanks alot mr.Tben

it`s will be nice if make it like this website
33 132Forum topics : 20Forum replies : 88Forum likes : 7
tbenmcp
tbenmcp
DLE TEAM
Commented By tbenmcp on August 21, 2011 (5:58 pm)
Gozan, that site, you don't need custom page, you jsut modify your shortstory.tpl, different themes different designs, so it's not really that complicate to make design

you can see here
front end show in main of shortstory.tpl
http://i-386.50webs.org/

inside category using same shortstory.tpl file
http://i-386.50webs.org/thriller/
20 150Forum topics : 11Forum replies : 248Forum likes : 32

"A True Friend is Someone Who Sees the Pain in Your Eyes while Everyone Else Believes the Smile on Your Face"
Let me Google for you!
Gozan
Gozan
V.I.P.
Commented By Gozan on August 21, 2011 (9:17 pm)
you can see here
front end show in main of shortstory.tpl
http://i-386.50webs.org/

inside category using same shortstory.tpl file
http://i-386.50webs.org/thriller/

very cool Tben
that`s what i`m talking about!!!
33 132Forum topics : 20Forum replies : 88Forum likes : 7
Gozan
Gozan
V.I.P.
Commented By Gozan on November 28, 2011 (5:02 am)
can we use this custom in some categories without changeing main.tpl

i main from only shortstory-no.tpl
and change shortstory.tpl from category section

i wish you understand what i mean tongue
33 132Forum topics : 20Forum replies : 88Forum likes : 7
spamhater
spamhater
DLE TEAM
Commented By spamhater on November 28, 2011 (11:31 pm)
you can add your category section without changing anything in main.tpl for sure for example:
{custom category="8,10,15" template="shortstory-no" aviable="global" from="0" limit="10" cache="no"}

you can add it on top of {content} tag without have to remove it...
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
Gozan
Gozan
V.I.P.
Commented By Gozan on November 29, 2011 (2:55 am)
sorry spamhater i don`t understand belay

there`s slider .css on my theme

and there`s shortstory-4.tpl with this code inside it:

<li>  <div class="r-news3">    <div class="r-news-t3">      [full-link]{title}[/full-link]    </div>    <div class="r-news-c3">      {short-story}    </div>    <div style="clear: both;height: 1px;"></div>    <div align="right">[full-link]|more...[/full-link]</div>    <div style="clear: both;height: 1px;"></div>  </div></li>



so i go to category section and specify this shortstory-4.tpl

see

and works fine but in one column and i want make 2 column if that possible

example
33 132Forum topics : 20Forum replies : 88Forum likes : 7
spamhater
spamhater
DLE TEAM
Commented By spamhater on November 29, 2011 (4:29 am)
try like:
<li style="width: 50%; float:left; display:inline> <div class="r-news3"> <div class="r-news-t3"> [full-link]{title}[/full-link].........</li>
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
Gozan
Gozan
V.I.P.
Commented By Gozan on November 29, 2011 (5:06 am)
<li style="width: 50%; float:left; display:inline> <div class="r-news3"> <div class="r-news-t3"> [full-link]{title}[/full-link].........</li>


and where to but this code request
33 132Forum topics : 20Forum replies : 88Forum likes : 7
spamhater
spamhater
DLE TEAM
Commented By spamhater on November 29, 2011 (7:07 am)
hahaha, my apology, the code is from your code above, the full code is
<listyle="width: 50%; float:left; display:inline"> <div class="r-news3"> <div class="r-news-t3"> [full-link]{title}[/full-link] </div> <div class="r-news-c3"> {short-story} </div> <div style="clear: both;height: 1px;"></div> <div align="right">[full-link]|more...[/full-link]</div> <div style="clear: both;height: 1px;"></div> </div></li>

If the problem still not get 2 columns then try like 49% or 48% instead of 50%
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
supramonto
supramonto
Members
Commented By supramonto on March 10, 2012 (7:52 am)
tbenmcp
I have problems in my site on local -- sorry for my bad english, I WANT TO CUSTOMIZE my template i had download it from here ..it called Mediatemplate ..I do not know how to write articles and put it on specify category or sub category .. and i have problem with URL menu ..so when I klik on a menu it goes to an invalid direction plz plz help me
N/A 1Forum topics : 0Forum replies : 0Forum likes : 0
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on March 10, 2012 (4:17 pm)
the localhost in windows will have different rewrite engine than in linux server..if you test the theme in localhost, you should use full url in theme links but if you want universal url, you have to use this http://www.dlestarter.com/tutorials/7-full_url.html in your theme otherwise your localhost with link that started with "/" will go back 1 folder...that's Windows Localhost and nothing you can do.
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
newasd
newasd
Members
Commented By newasd on June 28, 2012 (9:04 am)
Hello

I need to display the sub category with photos whene I click on the main category

can any one help me here
N/A 1Forum topics : 2Forum replies : 3Forum likes : 0
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on June 28, 2012 (11:27 pm)
you got to explain what exactly you need because we have no idea what you are talking about...
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
novanakal
novanakal
Members
Commented By novanakal on June 26, 2014 (1:09 am)
thx alot for this trick...

so powerfull
N/A 1Forum topics : 7Forum replies : 18Forum likes : 0
Information!Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.
DLEStarter Notice!Please note...Every hack and every module will get additional queries from your database and some hacks and some modules may result your server overload, so install only what you "need", remove any hacks and modules from your script when you don't need them, all hacks and modules appears in this website are not guaranteed by DLEStarter Team for your script security and compatibility, please read instruction carefully and use hacks and modules at your own risk...Thank you.