GetSimple Support Forum

Full Version: Custom Fields for galleries
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am new to GS and am blown away with what it can do. Thanks to everyone who has helped develop this.

My questions are, I would like to add galleries to some pages (probably with I18N Gallery), but would like to avoid having place holders in the editable section of the page where users my delete them. Apart from adding a new template style, is there another way, possibly with I18N Custom Fields, so that it wouldnt be so easy to screw up?

Is there any way to lock some pages from editing so that only admin can modify them? (possibly with multi user plug-in)

Thanks for any input that can be offered.
you could make a custom field, a dropdown with a list of the galleries and then on the page editor the user could select which, if any, gallery to show on that page. It depends on where that gallery needs to be output on the page... In your template you would need a conditional code to show the gallery. I have done this recently on a template, and i can dig up the code if need be...

ck editor also has a way to lock parts of the editor, so for example if you look at the source code, the tag would look like this:

Code:
<p>
{ % gallery % } </p>
and if you change that to:

Code:
<p contenteditable="false">
{ % gallery % } </p>
it will make that block read only, but the user can still inadvertently delete it;

another option would be to use i18n Special Pages, which would give you more control over the output;
islander Wrote:My questions are, I would like to add galleries to some pages (probably with I18N Gallery), but would like to avoid having place holders in the editable section of the page where users my delete them. Apart from adding a new template style, is there another way, possibly with I18N Custom Fields, so that it wouldnt be so easy to screw up?

You can use I18N Custom Fields, add a custom field named e.g. galleryname and add the following to your template (before or after get_content):
Code:
<?php
  $gname = return_custom_field('galleryname');
  if ($gname) get_i18n_gallery($gname);
?>

Or you can use I18N Special Pages, create a special page type for pages with a gallery with a special field galleryname and add similar code (get_special_field) to the view HTML/PHP code field.
Thank you for the quick reply.

alienee2 Wrote:you could make a custom field, a dropdown with a list of the galleries and then on the page editor the user could select which, if any, gallery to show on that page. It depends on where that gallery needs to be output on the page... In your template you would need a conditional code to show the gallery. I have done this recently on a template, and i can dig up the code if need be...

ck editor also has a way to lock parts of the editor, so for example if you look at the source code, the tag would look like this:

Code:
<p>
{ % gallery % } </p>
and if you change that to:

Code:
<p contenteditable="false">
{ % gallery % } </p>
it will make that block read only, but the user can still inadvertently delete it;

another option would be to use i18n Special Pages, which would give you more control over the output;


If you have those snippets easily accessible, and it is a different solution that mvlcek's, that would be great time saver.

I have not loaded either of these extensions yet, so off I go to experiment...

Thanks for the awesome tips.