Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Multiple Inline Edit Areas

edited March 2011 in Modules
Is it possible to make a static page have multiple edit areas, or have a editable page be partially static?

Basically, instead of just having the inline BODY tag be able to be inline editable, I want to have multiple areas on the same page that can be editable, without having everything be editable.

I'd like this to be a somewhat easy thing to implement for almost every page on the site, in many different areas. Maybe I have to create some kind of custom module to do this, or maybe the FUEL helper is what I need... something like the fuel_edit or fuel_var functions. Not sure.

Perhaps I should ask if there exists some other CodeIgnitor-based CMS that can do this out of the box? I'm liking what I see with this CMS and I really want to use it for my next project.

Comments

  • edited 12:52AM
    Sure. You just need to change your values in your fuel/application/config/MY_fuel_layouts.php. Here is a page that helps explain it.
    http://www.getfuelcms.com/user_guide/modules/fuel/layouts

    You can create any number of layouts you want by adding to that file. The key 'main' says which layout file to use (fuel/application/views/_layouts). You can add your own layout files to that folder.
  • edited 12:52AM
    I'm having trouble understanding how to enable inline editing. I have read the layouts page in the User Guide, as well as the fuel_helper page. However, it's not clear to me how all of the pieces get put together.

    I would like to at least begin to know how to make '_block's' editable--or if that's even possible. The following is what I have in my _block "featurecontent.php": <?php echo fuel_var('feature_content', 'Feature Content');?>">

    ...and this is what I added to MY_fuel_layouts.php...but don't know what I should put in the 'lang':

    'feature_content' => array('label' => lang('what goes here?')),

    Perhaps I'm going about this the wrong way?

    Thanks in advance!

    - B
  • edited July 2011
    You may want to read this page in the User Guide if you haven't already:
    http://www.getfuelcms.com/user_guide/general/inline-editing

    Are you wanting to have a page layout variable be "feature_content" or do you want a block to be "feature_content"?

    If you want it to be a page layout variable, then the field will appear for each page in the CMS and would be unique to each page. In that case, you would use something like the following in your views/_layouts/main.php to have the inline editing appear (where main.php is the layout being used, but can be any layout):
    ... //layout HTML code like header <div id="feature_content"> <?php echo fuel_var('feature_content', 'Default content goes here')?> </div> ... //layout HTML code like footer

    If you are wanting a block to be editable instead, this would most likely mean that you are wanting something editable that is repeated on multiple pages (e.g. like a header or footer). To make that editable, you can do the following if it is in a static view file you are rendering from, but note that the $my_block variable must be passed to the view file or layout:
    <div id="feature_content"> <?php echo fuel_edit($my_block->id, 'Edit Block '.$my_block->name, 'blocks')?> </div> This method applies to any module data you want to make inline editable.

    Alternatively, you can also use the fuel_block function which provides a shortcut to include a block and make it editable (if the "edit" parameter is set to true which it is by default).
    <div id="feature_content"> <?php echo fuel_block('feature_content')?> </div>
Sign In or Register to comment.