Jump to content

beta delegate profile


Martijn Geerts
 Share

Recommended Posts

delegate profile

Basically the home & basic-page template have the same fields.

  • Home » home template
    • Basic-Page » basic-page template
    • Search » search template
    • Widgets » widgets template » status:hidden
      • widget-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 pages
        • Position left or right » settings template » status:hidden » no file » access:guest view pages
          • Left 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

post-577-0-84543900-1357244920_thumb.png

post-577-0-22031300-1357244922_thumb.png

post-577-0-59041700-1357245097_thumb.png

Edited by Martijn Geerts
  • Like 1
Link to comment
Share on other sites

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]; 
  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...