Hello,
I am new to Drupal and Marinelli theme. I would like to know if it's possible to switch the places of the Blocks and the actual content of the theme in the "main" area (not the sidebars). Basically, what I would like to do is have some blocks with custom content as the first thing the user sees in the main column/area of the Marinelli theme, and then the new stories appearing below these blocks so that the user can scroll down to see more stories or just-posted things.
The goal I am trying to achieve is to have some static content like "about us" or a description of what someone would find on the page to always appear first, and then any new stories will appear further down, if this makes it more clear. I assume the "style.css" must be changed for something like this to work?
Thanks in advance for your help, and thanks to Marinelli team for contributing such a great theme.
-Mike
Comments
Comment #1
mikesfx commentedSorry guys I believe I should tell myself to "RTFM"
LOL.
Thanks anyway for your help.
-Mike
Comment #2
Winters-1 commentedLet everyone know what you found, help out other people who might be looking for the same thing :)
Comment #3
mrbrowny commentedHi "mikesfx" and "Winters", i'm looking for exactly the same thing "mikesfx" is asking in the first post. How do i make to display the blocks BEFORE the content and not AFTER? (as is displayed by default)
I really need this info because i need to have the blocks in "content region" to be seen before the content.
Thanks in advance!
Claudio Abraham
(mrbrowny)
Comment #4
mrbrowny commented*** SOLUTION ***:
Well people, as i'm a little bit hurry, i have made the successfull code to add this feature.
All of this is based in adding new regions to the theme and its variations (Marinelli, Giordani and Gnifetti).
As i have tested, when i added a region before the content itself, i figured out that there were, indeed, three useful regions (locations) to place blocks, so i added the three of them. Anyway if you don't use those regions, the layout won't be affected.
Note that i'm using Giordani subtheme of Marinelli, but it works for all three themes in Marinelli pack.
The only thing you need to see is that in Marinelli, the content section in page.tpl.php is before the left and the right column, and in Giordani, the content is between de columns and in Gnifetti, the content is after the two columns. Just to have no problem while searching the code.
Zero Step - BACKUP UP YOUR FILES BEFORE CHANGES!
------------------------------------------------
That's it, you know, even the more clever programmer forgets this step sometimes.
I have tested the following changes, but sometimes things may not work (perhaps of misunderstanding the tutorial, or other causes)
First Step - Creating the new regions: (theme.info file)
--------------------------------------
Get marinelli/giordani/giordani.info (then do this gnifetti if you want), locate the following line:
Note that in Marinelli (marinelli.info) the line mentioned "base theme = marinelli" will not be there so just insert your code anywhere, or after the "stylesheets[all][] = links.css" line.
And after that line, add the following data:
And that's the end of first step.
Now we need to place the new regions in the template, to make them be displayed.
Second Step - Placing regions in template: (page.tpl.php file)
------------------------------------------
Get marinelli/giordani/page.tpl.php (then do this in marinelli and gnifetti if you want), and locate the following lines:
And right after that lines, add the following code:
Then in the same file locate the following lines:
And again right after that lines, add the following code:
After that, in the same file locate the following lines:
And again right after that lines, add the following code:
That's it, end of changes in the second step.
To be more clear i will show you how the second step was, and how it should be left.
So the original part of the code in Giordani subtheme is:
And the result after adding the lines should be:
Please note that NO ALTERATIONS were made to the original layout or the original values, variables or data. Only were added the regions in the content column.
And that's the end of the second and last step.
Now if you want you should replicate this changes in Marinelli and Gnifetti themes, and also this changes are so clear and simple, that you should apply them to other themes without problem (although i didn't tested them in other themes)
Third Step - Cleaning the cache to see the new added regions:
-------------------------------------------------------------
When you create new theme functions or templates in Drupal 6 you must clear the theme registry. To do this you have to:
- Press the "Clear Cached Data" button located at "Administer -> Site configuration -> Performance"
This works as planned but if you are making lots of changes in the themes, and refreshing continuously and is preety annoying to go to that page and press that button, you may:
- Call the function drupal_rebuild_theme_registry(). Place this at the top of your template.php file while you're developing the site & then remove it from production to prevent huge server load (because it will clear the cache every time the theme is loaded)
You will now have see the three additional available regions on the block configuration page.
And here finishes the third step.
And also this tutorial and feature request, hope you like it and i really hope, the Marinelli team, to add this useful regions (you may change the regions name if you want) to the following release.
See you and tell me if there is any comment.
Claudio Gaston Abraham
(mrbrowny in Drupal.org)
From Argentina
South America
Useful information used make this feature:
http://drupal.org/node/283543
http://drupal.org/node/132442#defining-regions
http://drupal.org/node/171224
http://yubastudios.com/blog/drupal-creating-new-regions
http://drupal.org/node/292028
Comment #5
mormorrona commentedAwesome!! I was looking exactly this!!! Did you read my mind?! :D
Comment #6
mrbrowny commentedHahahhaha, i'm glad this solution helped you. Ok if you have any doubt about my solution, just ask me!
See you!
Comment #7
Abilnet commentedThanks mrbrowny, that was exactly what also I was missing in this wonderful Marinelli theme! Hopefully the patch will end up to next release. All your guys work very much appreciated!
Comment #8
summit commentedWill this patch go in?
Thanks a lot for considering this!
Greetings,
Martijn
Comment #9
mikeytown2 commentedI'm also interested in this patch going in
Comment #10
computer_jin commentedGreat Post but..
I dont want to create regions in my theme because there is a option in my application from which user can change theme so basically there are thousands of themes available , and for this i have to create region in every theme thats why i need a solution for this without creating new regions .........
Any help ?
Thanks
Comment #11
frdesign commentedIt seems to me you could create a custom node template and embed the block before printing the node content. See this thread for how to embed a block.
http://drupal.org/node/164799
Comment #12
SMonsen commentedThanks to mrbrowny, that example worked perfectly. But Now I'm trying to add regions above on another theme (jaded) and it's not built the same. So watch your theme. It may not work.
Comment #13
mrbrowny commentedHi manteiners of Marinelli!
I've seen that many people has tested my solution to add more regions published in #4 ( http://drupal.org/node/292028#comment-1027837 )
Note that a full year has passed from the solution i gave. (published in september 2008 -now we are in sept 2009-)
I'm changing the status to "reviewed & tested by the community".
Would you add it to Marinelli and it's subthemes? It's so important for many of us to have those regions :)
That would be really helpful because everytime i apply your updates of Marinelli theme you publish, i had to manually add this patch of regions.
Note that this doesn't harm the integrity of the theme, because anyone may choose to use or not use those new regions.
Thanks a lot, hoping to see this new regions in Marinelli 6.x-2.97
Claudio Gaston Abraham
(mrbrowny in Drupal.org)
From Argentina
Comment #14
mikeytown2 commented@mrbrowny
Do you know how to create a patch? I recommend doing that.
http://drupal.org/node/323
Comment #15
mrbrowny commented@mikeytown2
No i don't but now i think i'm gonna learn hahah
Thanks for the link :)
I'll try to make the patch so the manteiners may add this feature to this great theme.
Comment #16
sorensong commented@mrbrowny
I would LOVE you if you made a patch for this issue. What do you think the chances are?
Comment #17
MiraKimura commentedI agree! And thanks for this solution. Brilliant! ;)
Comment #18
hackmac27 commentedI'd like to create a new region below the primary links, but only on the right side of the page above the left and the right sidebars. How do I define the width? It has to be some sort of fixed value. In my case it should be 370 pixels, with region alignment to the right.
Comment #19
sandwormblues commentedAll i did was find
print $breadcrumb;in page.tpl.php and writeprint $header;underneath. Is there a reason i shouldn't have done this?Comment #20
alofi commentedsandwormblues, thanks! it works!
Comment #21
atheologist commentedDoes the current version 6.x-2.96 dated 8/25/2009 have this feature now? Or do I need to go cutting and pasting all this code into these different places?
Comment #22
tweety_ag commentedWe are in 2012, has this been patched through? It will be of great help to all the users like us!
Comment #23
tweety_ag commentedI tried this and did not work for me. Apparently it changed the appearance of my current blocks!
Comment #24
mcarlson commentedVery helpful! Thanks for taking the time to post this in detail. :-)
Comment #25
oadaeh commentedThis issue is being closed because it is against a branch for a version of Drupal that is no longer supported.
If you feel that this issue is still valid, feel free to re-open and update it (and any possible patch) to work with the 7.x-4.x branch.
Thank you.