[SOLVED]making content blocks invisible

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
size
New Member
New Member
Posts: 9
Joined: Sat May 19, 2007 8:29 am

[SOLVED]making content blocks invisible

Post by size »

I have made a template that has many content blocks including places where you can paste code. the page is for a property discription

this template is the final page in a directory type application

I  want to add on this template some content blocks that will not be shown on the page but the data could be used to build an index to the final pages.

i.e I would like to add a short blurb, image and possible a dropdown on the EDIT CONTENT PAGE  is this possible and if so can someone lead me in the right direction

p.s I have looked at cataloger, cart, simple cart and products modules but the final  page have fields I don't need, I would really like to add data for each property on one page in the edit content area,
Last edited by size on Tue Mar 24, 2009 10:50 pm, edited 1 time in total.
User avatar
aln_cms
Forum Members
Forum Members
Posts: 88
Joined: Mon Jan 08, 2007 7:09 pm
Location: Ireland

Re: making content blocks invisible

Post by aln_cms »

Hi,

Could you wrap it in {content block="hidden"}

Alan
--
Alan Ryan
Lead Developer
CodeCrunchers Internet Software Development - Ireland
http://www.codecrunchers.ie
nhaack

Re: making content blocks invisible

Post by nhaack »

just place {content block="my_other_block" assign=var_blockname} into your template. This will hand the content from the block "my_other_block" to the variable "var_blockname". As a result, the block will not be shown at all on the final page (no need to hide with CSS).

For generating the overview, you can use the content_dump plug-in (just as an idea - check the wiki for a comprehensive overview of possibilities).

Best
Nils
size
New Member
New Member
Posts: 9
Joined: Sat May 19, 2007 8:29 am

Re: making content blocks invisible

Post by size »

thank you for both your inputs

the assign var looks like it works and will read the wiki on content_dump

**just to note I have found through pure accident that using html comment tags i.e also does what I want, shows the content block in the EDIT CONTENT PAGE  but does not show it on the website.

would there be any reason this wouldn't work technically? as it seems like it maybe something that hasn't been programmed

thanks
nhaack

Re: making content blocks invisible

Post by nhaack »

Technically it works on a visible level. But if you comment out the block or hide it with CMS the text can still be seen in the source code. In the case of CSS, by search engines as well. Personally, I always go for assigning the data to a variable...
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: making content blocks invisible

Post by RonnyK »

You can exclude contents from being rendered by putting them between {* ... *}

like
{* {content block="some-block"} *}
The block will show in the edit-content, but wont be in the source of the page. This makes it usable as a documentation-box for the page as well....

Ronny
nhaack

Re: making content blocks invisible

Post by nhaack »

Thanks Ronny! I guess {* ... *} is commenting syntax for smarty? Now as you mentioned it, I'm sure I've had the exact same discussion a month ago or so... will write this into my little booklet right away ;D

Best
Nils
size
New Member
New Member
Posts: 9
Joined: Sat May 19, 2007 8:29 am

Re: making content blocks invisible

Post by size »

hi again,

just to continue the conversation after playing around with the different ways suggested to make content invisible and then using the content_dump plug-in as suggested, great for what I am wanting to achieve and almost done!  ;D

is there any benefit in assigning a var to the content block over using smarty comment tags {*.......*}?

 
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: making content blocks invisible

Post by Dr.CSS »

Six of one half dozen of the other...
Post Reply

Return to “Developers Discussion”