php - Editable pages in FuelCMS -


i started working cms (and codeigniter). chose fuelcms because of languages,...

so far, works fine. have controller handles pages, languages,..

i made hierarchy of pages under views:

de/page1

de/page2

uk/page1

uk/page2

but want edit specific content of page. have 2 blocks use time: header , footer. page1 looking this:

<?php $this->load->view('_blocks/de/header')?> // here want editable content of page... <?php $this->load->view('_blocks/de/footer')?> 

but it"s not clear me how can page in fuelcms. if make them directly in cms test while ago worked. can't work custom controller.

how can show pages in cms , let them edit content-part of page?

i don't follow question 100% i'll try help. assuming you're using version 1.0 , want have editable layouts under "pages" in admin interface.

the first thing you'll want open /fuel/config/my_fuel.php , add these:

// languages pages. key saved page variables $config['languages'] = array(     'en' => 'english',     'de' => 'dutch' );  $config['language_mode'] = 'segment'; 

then, open /fuel/config/my_fuel_layouts.php , create layout. here's basic one:

# common meta $common_meta = [     'meta' => [         'type'  => 'fieldset',         'label' => 'meta',         'class' => 'tab'     ],     'meta_section' => [         'type'  => 'copy',         'label' => 'the following fields control meta information found in head of html.'     ],     'body_class' => [],     'page_title' => [         'label' => lang('layout_field_page_title'),         'description' => 'this displays @ top of browser bar.'     ],     'meta_description' => [         'style' => 'width: 520px',         'label' => lang('layout_field_meta_description')     ],     'meta_keywords' => array(         'style' => 'width: 520px',         'label' => lang('layout_field_meta_keywords')     ] ];  # common content $common_content = [     'common_content' => [         'type'  => 'fieldset',         'label' => 'content',         'class' => 'tab'     ],     'page_heading' => array(         'label' => 'page heading',         'description' => 'this displays @ top of page in content'     ],     'body' => array(         'label' => lang('layout_field_body'),         'type'  => 'textarea',         'description' => lang('layout_field_body_description')     ] ];  $main_layout = new fuel_layout('main'); $main_layout->set_description('this layout pages.'); $main_layout->set_label('main'); $main_layout->add_fields($common_content); $main_layout->add_fields($common_meta); 

make sure you've got file called main.php in /fuel/application/views/_layouts

when head pages/create in fuel, you'll see "language" select under layout 1 in top of page. how set different language content same layout.

this how these 2 pages made: http://impression.co.nz/sell http://impression.co.nz/ch/sell

if still need controller intercept, can render cms page controller with:

$this->fuel->pages->render('url', [], ['render_mode' => 'cms']);

where url "location" value in admin , empty array vars may want pass it.

does help? or way off?


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -