Martijn Geerts Posted December 29, 2012 Posted December 29, 2012 (edited) delegate profile Basically the home & basic-page template have the same fields. Home » home templateBasic-Page » basic-page template Search » search template Widgets » widgets template » status:hiddenwidget-one, Left, Left widget » widget-one template widget-two, Right, Right widget » widget-two template [*]404 Page Not Found » basic page template » status:hidden [*]Admin Settings » settings template » status:hidden » no file » access:guest view pagesPosition left or right » settings template » status:hidden » no file » access:guest view pagesLeft setting template » no file Right setting template » no file [*]Trash defaults.inc The home & basic-page templates include ./include/defaults.inc on top and on the bottom ./includes/main-view.inc. The defaults.inc is the file for common defaults, scripts & variables. Also there's living for commonly used functions & the 12 column classname generate thingy. the 12 column grid On the home & basic-page pages you can check to disable the left & right widgets. If there are no left-widgets to render, then there's no use to render the column at all on the page. The content column then receives the width of the left-column. There are in total 12 columns, say the right column has a width of 3 and the left has a width of 4, then the leftover for the content column is 5. So if there are no left widgets, then the content colum is 9. Those numbers are set to their written equals or set to FALSE. $column['one'] could be FALSE or one, two, three, four, five, etc. $column['two'] could be FALSE or one, two, three, four, five, etc. $column['three'] could be FALSE or one, two, three, four, five, etc. main-view.inc The main-view.inc is the main markup file. In this file I'll check if "template-name.css" & "template-name.js" exists and the append them to the syles & scripts array before I output them with a foreach loop in the page head. This way I know that basic-page.css for example is always the last file & can overwrite previously set styles. The grid uses the same source ordering approach as the zurb foundation grid uses. For mobile it's often a pre that the content column is showed first but on desktop there's plenty space to have a left column first. Thereby I think that Google loves content higher in the source more then if that content is a latecomer. widgets The widgets are just chunks of HTML without <head>, <body> etc. So they can be rendered with the build in Processwire render() function. Nothin' special there. download delegate profile Edited January 3, 2013 by Martijn Geerts 1
ryan Posted December 31, 2012 Posted December 31, 2012 Thanks for sharing this with us, looks good! Please post to the modules directory (under the site profiles category) when ready. As a small, though not really necessary optimization, that big switch statement might convert nicely to something simpler: $names = array(null, 'one', 'two', 'three', 'four', ...and so on); $column[$key] = $names[$value]; 1
Pete Posted December 31, 2012 Posted December 31, 2012 Without actually installing it, what does this profile actually have by default?
Martijn Geerts Posted December 31, 2012 Author Posted December 31, 2012 Tnx ryan for lookin at it. Will implement the improvement. @pete, wil tell more about it later. Have not much time these days.
Martijn Geerts Posted January 3, 2013 Author Posted January 3, 2013 I've updated the first post. Changed the big switch as ryan mentioned. For pete & all others gave a better description & attached some screen shots. 1
ryan Posted January 4, 2013 Posted January 4, 2013 Thanks for adding to the modules directory. I have updated your listing with some additional text description and your screenshots. Feel free to change if you'd like: http://modules.processwire.com/modules/delegate-profile/ 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now