php - Custom block (layout?) containing other blocks in Concrete5 -
i make number of websites clients are... less tech savvy... , need easy means of editing website after i've made them. purpose have been coding lot of sites in concrete5.
recently received project translate http://www.windowfashionsonwheels.com concrete5. quick glance @ source-code reveals it's nothing tables inside of tables... it's pretty hideous. i've been steadily working rebuild exact appearance , structure using minimal html , css, ran 1 small bump.
on main page if scroll down there light-grey box along left side of main body containing 4 different blocks of content. section has different background color, rounded corners, , gradient borders make job little bit harder.
i can emulate appearance of box creating single content block in concrete5 , applying custom design (background color, css3 rounded corners, , css3 image borders). since relies heavily on css3 doesn't display in older browsers or internet explorer, plus allows me single content block work (not ideal if wanted have text , slideshow or other block within same light-grey square)
i add light-grey square theme itself, doesn't appear on pages. seems work create 2 different page types, 1 pages grey box , pages without.
i create custom template content block generates these <div>
objects, allowing me place them in arbitrary locations on page desire - allow light-grey box contain single content block. not allow me have, say, content block , slideshow block in same box.
i add html block, wish assume client has no knowledge of html , want able edit own page.
the ideal solution create block generates new background , borders (using multiple <div>
objects create rounded corners , such old fashioned way) allow placement of blocks within block have sort of content want. far aware, concrete5 doesn't allow blocks inside of blocks. does, however, allow blocks inside of layouts - far know layouts intended multi-column pages, not specialized borders.
if has experience concrete5 , has solution problem, please help.
for specific situation here, sounds creating new page type ideal solution. "seems work" creating page type easiest of options (way easier creating own block in cases, although see below more details on that). have copy current template file, rename it, add new html grey box, , put "area" code inside new grey box html (where content is):
<?php $a = new area('grey sidebar'); $a->display($c); ?>
then go dashboard -> pages , themes, click "inspect" button next current theme, , you'll see checkbox next new page type -- click "install" button (or whatever it's called, can't remember, it's obvious when see it).
now, looking @ site linked also seems content inside grey box "designed" , sticks consistent format (title, thumbnail, paragraph). if want ensure format maintained while still making easy non-technical users edit content, i've created block generator addon exact situation: http://concrete5.org/marketplace/addons/designer-content
if building site, combine both of techniques (a page type surrounding grey box html, , custom block made designer content each interior block). perhaps in situation don't want contents of grey box same (like on site linked to) -- in case make page type grey box , best "isolate" interior contents style whatever blocks user adds won't accidentally interfere grey box surroundings (basically make sure there's big <div> surrounding "area" code , set explicit widths or whatever need in surrounding html/css).
Comments
Post a Comment