Posted by pkcho on December 19, 2010 at 7:58am
Can someone explain how the Tabbed "most commented"/"most viewed" block is created on the Frontpage?
I went to the Frontpage Context and disabled the "most viewed nodes by type", saved, then went to the frontpage and saw that the "most commented" content was by itself. When I re-enable the "most viewed nodes by type" in context, and position it beneath the "most commented" content, the tabbed block reappears.
Comments
It's styled like that using
It's styled like that using css.
Thank you for clarifying that
Thank you for clarifying that for me.
you guys think it could be
you guys think it could be styles to contained more tabs? I cant find any documentation on openpublish's site...
It can if you know how to
It can if you know how to modify CSS. Just add another view next to those two views in the front page context and style it with CSS.
Thanx for your reply. That is
Thanx for your reply. That is actually part of my question: the thing is that in the view, under basic options, the CSS class field says none (sorry my openpublish is in spanish, but i guess thats the correct translation) Any thoughts?
I assume OpenPublish is
I assume OpenPublish is styling this in sites/all/themes/openpublish_theme/css. Use CSS in your subtheme and don't worry about the Views CSS field.
Nice i will give it a try and
Nice i will give it a try and post results afterwards!
Hey guys, sorry i didnt write
Hey guys, sorry i didnt write after for a while, quite a while i must add. Anyway, i still havent been able to manipulate the tabs. I see that they have a structure like this:
< div id="combinedblock" >
< div class="combined-header" >
< h3 content="block-views-most_viewed_by_node_type-block" style="width: 152px;" >TITLE 1< /h3 >
< h3 content="block-views-most_commented_articles-block_1" style="width: 152px;" >TITLE 2< /h3 >
< /div >
< /div >
< div class="combined-content" >
this one has all the code from the views displayed as blocks.
< /div >
So, i still dont understand how the combined-header is created, cuz it even has some style="" tag and properties. Maybe someone can help out. thanx!
Here it is
Openpublish define combinedBlock in the openpublish_core module. If we want to change de funcionaluty of that tabs, we need to edit the file openpublish_core.module (sites/all/modules/openpublish_core)
1) Go to line (aprox?) 58
2) You will see an array with subarrays. Each subarray represents a group. When you enable the relevants modules, you can see every group in a tabbed way in the frontend. Each subarray have 2 indexes (per default). Each index, represents a tab in the group.
3) To add a new tab, you must add a new index, where the index value is your block ID (CSS ID).
4) Add custom CSS to style your tabs, and adjust width
5) I think, enjoy!
PD: sorry for my english, I need to practice my writing a little more ... :)
Thanx fjcero! This is the
Thanx fjcero!
This is the explanation that I've read that can actually shed some light on my question. I've decided to go with another solution for the tabs, which is QuickTabs. You can select any block and put it into tabs and has an easy administration. I think openpublish should have a module like this or incorporate this one.
Thnks!
I'd like to apologize for my
I'd like to apologize for my previous comments in this thread, as I was very wrong! I assumed that OP was simply using CSS to push the views together, but I didn't check to verify, and as others have noted since then there is more going on. fjcero identified the code that OP is using, but modifying the openpublish_core.module file is not a good practice. You should create a module of your own to put all custom changes. In that custom module, add something like:
function your_module_init() {$combineBlocks = array(
array("#block-views-most_viewed_by_node_type-block", "#block-views-most_commented-block"),
);
drupal_add_js(array('combineBlocks'=>$combineBlocks), 'setting');
}
Obviously change the block ids to whatever your particular blocks are. It's as simple as that!
How I can display captcha in register page.
Hi,
How to display captacha on register form?
Thanks in advance.