tabbed yahoo-like block
tabbed yahoo-like block
Hi.
I would like to create yahoo.com - like tabbed block (for example:
Featured
Entertainment
Sports
Video
)
Is some block available with this feature?
If not, how can I create something like this? I mean how to create html markup - I can create js tabs, but I'm currently unable to create block with few categories
Sorry for my language errors - english isn't my native language
I would like to create yahoo.com - like tabbed block (for example:
Featured
Entertainment
Sports
Video
)
Is some block available with this feature?
If not, how can I create something like this? I mean how to create html markup - I can create js tabs, but I'm currently unable to create block with few categories
Sorry for my language errors - english isn't my native language
Sorry for my language errors- It`s not my native language.
Re: tabbed yahoo-like block
I'm not sure which part of yahoo.com you want to create exactly, but if you're looking for a s9y theme with a customizable navigation bar (which can also consist of horizontal tabs), you might want to check out Bulletproof.Krzyzak wrote:I would like to create yahoo.com - like tabbed block
Is some block available with this feature?
Otherwise, I need more input
YL
well, look at the top of yahoo.com - there's block with news - categories: (News World Local Finance) - I would like to create something like this.
Or, maybe other way to explain, what I want to do:
I would like to have on main page -let's say- 5 news for each categories, which I'll display in one tabbed-block
Here's some screen with block, which I would like to create
Or, maybe other way to explain, what I want to do:
I would like to have on main page -let's say- 5 news for each categories, which I'll display in one tabbed-block
Here's some screen with block, which I would like to create
Sorry for my language errors- It`s not my native language.
Phew. Now, that's a tad more complicated since you want "real" tabs (at least I assume you want "real" tabs).Krzyzak wrote:I would like to have on main page -let's say- 5 news for each categories, which I'll display in one tabbed-block
Here's some screen with block, which I would like to create
The tabs part isn't even that hard to do - you're probably going to want Javascript for that. Personally, I like this tabber script, but there are more solutions out there. But since your "original" is by yahoo, maybe there is some code for that in the Yahoo UI ..?
The hard part is to get the content you want to display, and I'm still not sure what that would be ... something like the 5 recent entries for each category?
YL
exactly. I can create js markup, however - I need html with entries.The hard part is to get the content you want to display, and I'm still not sure what that would be ... something like the 5 recent entries for each category?
So, how can I get 5 entries for each category on main page ?
Sorry for my language errors- It`s not my native language.
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
There are a lot of tabbing scripts out there that degrade gracefully when a visitor does not have javascript. Tabber, as Yellowled mentioned, is a good one. I used jquery to do a site quite some time ago... ultimately, the site has not really achieved its original objective, but you can see it here: http://www.blogs.showbuzzonline.com/
As an example, to retrieve the 5 most recent entries for a category #25, using a custom smarty template called "entries_custom.tpl", you can use code such as this in index.tpl:
More information on serendipity_fetchPrintEntries can be found here: http://www.s9y.org/78.html
As an example, to retrieve the 5 most recent entries for a category #25, using a custom smarty template called "entries_custom.tpl", you can use code such as this in index.tpl:
Code: Select all
{serendipity_fetchPrintEntries limit="0,5" category="25" template="entries_custom.tpl"}=Don=
that's what I was looking for, thanks!As an example, to retrieve the 5 most recent entries for a category #25, using a custom smarty template called "entries_custom.tpl", you can use code such as this in index.tpl:
Code:
{serendipity_fetchPrintEntries limit="0,5" category="25" template="entries_custom.tpl"}
Now, I've got another problem: how to use this code only on home page? So, I would like to have this tabbed block on home page, but when I'll click on article link, then I'll see it's content?
I mean something like this to index.tpl:
Code: Select all
{if $is_home_page}
{$CONTENT}
{/if}
{else}
{serendipity_fetchPrintEntries limit="0,5" category="25" template="entries_custom.tpl"}
{/if}Sorry for my language errors- It`s not my native language.
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Your request becomes a bit more complicated - but not impossible!!
2 guys - whom I sincerely respect - and I came up with a template named "Bulletproof". In that template, we use a technique to detect the true frontpage of a serendipity install (the code of which I think was actually provided by another great guy named Abdussamad)....
A template can have a file named config.inc.php.. in the bulletproof template we have this code:
I STRONGLY encourage you to look at all the code for that template. But this one line is setting a template variable named $currpage.
While we are not doing this in Bulletproof, we can, in index.tpl, evaluate whether this $currpage variable is the same as the URL that you have specified for your site:
This gives us a condition for determining if the page a visitor is viewing is actually the "frontpage", and if so, emit our desired code. Give that a try and let us know how it works out.
Note specifically to Garvin: we have a smarty $view variable for "start", but it applies to more than the true frontpage. This smarty variable will also apply to the contact form, static pages, and who knows what else. I think we could use a smarty variable for the true frontpage. Let me know if we can do this for 1.4.
2 guys - whom I sincerely respect - and I came up with a template named "Bulletproof". In that template, we use a technique to detect the true frontpage of a serendipity install (the code of which I think was actually provided by another great guy named Abdussamad)....
A template can have a file named config.inc.php.. in the bulletproof template we have this code:
Code: Select all
$serendipity['smarty']->assign(array('currpage'=> "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']));While we are not doing this in Bulletproof, we can, in index.tpl, evaluate whether this $currpage variable is the same as the URL that you have specified for your site:
Code: Select all
{if $currpage==$serendipityBaseURL}Note specifically to Garvin: we have a smarty $view variable for "start", but it applies to more than the true frontpage. This smarty variable will also apply to the contact form, static pages, and who knows what else. I think we could use a smarty variable for the true frontpage. Let me know if we can do this for 1.4.
=Don=
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Regard,s
Garvin
I'm not sure if this can be done without changing every plugin. I believe you might need to use {if $view == 'start' AND $staticpage_pagetitle == ''} to deduce the real startpage? This works at least with plugins that set this $staticpage_pagetitle variable...Note specifically to Garvin: we have a smarty $view variable for "start", but it applies to more than the true frontpage. This smarty variable will also apply to the contact form, static pages, and who knows what else. I think we could use a smarty variable for the true frontpage. Let me know if we can do this for 1.4.
Regard,s
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Thanks Garvin - if that condition works for determining the frontpage, great. My intent was not to change every plugin, just possibly introduce a new smarty var that templates could use going forward.... but again, if the code you mention already does that, then there is no reason to introduce something new.
=Don=
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi Don!
I'm not 100% sure if it works. But I have high hopes that it could.
Regards,
Garvin
I'm not 100% sure if it works. But I have high hopes that it could.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Just tripped across a plugin that this does NOT work for....garvinhicking wrote:I believe you might need to use {if $view == 'start' AND $staticpage_pagetitle == ''} to deduce the real startpage? This works at least with plugins that set this $staticpage_pagetitle variable...
Regards,
Garvin
The permalink plugin does not change $view to 'entry'. Can that be easily corrected?
=Don=
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Hm, but the PHP code of that plugin does set $serendipity['view'] = 'entry' inside the code, so I don't really understand...you do call the permalink URL in that case?
Regards,
Garvin
Hm, but the PHP code of that plugin does set $serendipity['view'] = 'entry' inside the code, so I don't really understand...you do call the permalink URL in that case?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/