Page 1 of 1

template using JS expanding and contracting content

Posted: Sun Jan 20, 2008 7:00 am
by Tracy
I'm trying to build a new template and page using my webpage already designed. This page is an advice column for a client which he wishes to update himself. I have used a javascript so that the Question heading is clicked on and the Response is then expanded. I have numerous Q & Rs on the page. 

I want to build the template so it works exactly the way it does now but I am having problems with the {content} blocks and where to put them. It just isn't working and I've been at it for hours. Here is some of the code, I don't know if you need to see the Javascript part in the head. This is a link to my page  http://www.zendog.ca/columns_expand.html  and the code below  Please help.

Contract All | Expand All

Beginners Mind
Q: I am a young Saalish man who participates fully in  the customs of my people as they are being taught by our elders in accord with  our ancient traditions.  These ceremonies  and songs are  meditation add something in my attempts  to reach back to the source of my peoples' wisdom?

  R: An interrupted lineage functions something  like a severed spinal cord.  Corporate  entities which establish complex customs, myth and religious mechanisms  communicate essential and subtle wisdom and knowledge.  When these cultural artifacts cease, the mere  forms may not be enough to transmit the most subtle knowledge.  In the human body we find that the nerve  tissue of the spinal cord does not regenerate easily once severed.  Similarly, when cultural or religious  lineages are severed they are often difficult to mend.
 
 





Something Missing
Q:

  I  am a 48 year old housewife. I love my husband and our two children, who
  are  now living on their own and both doing well. I know my husband loves me
What else do I need to do to become  happy?


R:
    You  have done everything human society prescribes to be happy.  Despite having been born into 'good family'  and being fortunate in love and health, there remains something missing.  How can it be that deep happiness is so  elusive?  It is not supposed to work out  that way; happiness is supposed to be our birthright, contingent only upon our  assimilating and internalizing a critical mass of expedient means and  conventional ideas. In our world this whole normative edifice
   





I appreciate your time

Re: template using JS expanding and contracting content

Posted: Sun Jan 20, 2008 9:43 am
by alby
Tracy wrote: I'm trying to build a new template and page using my webpage already designed. This page is an advice column for a client which he wishes to update himself. I have used a javascript so that the Question heading is clicked on and the Response is then expanded. I have numerous Q & Rs on the page. 
Look also in Tag/plugin for startExpandCollapse and in forge for startExpand

Alby

Re: template using JS expanding and contracting content

Posted: Sun Jan 20, 2008 10:29 am
by Tracy
Thanks for the reply, I found the pluggin and downloaded. Although I was guessing how. I downloaded the zip into my clients folder on my computer and then unzipped it into the plugins folder withing the cmsmadesimple folder. Is this correct? Then I uploaded it with my ftp to the plugins folder there. Is this correct? Now I haven't got a clue what to do now!  ???

Re: template using JS expanding and contracting content

Posted: Sun Jan 20, 2008 1:55 pm
by alby
Tracy wrote: Thanks for the reply, I found the pluggin and downloaded. Although I was guessing how. I downloaded the zip into my clients folder on my computer and then unzipped it into the plugins folder withing the cmsmadesimple folder. Is this correct? Then I uploaded it with my ftp to the plugins folder there. Is this correct? Now I haven't got a clue what to do now!  ???
Always try and test before on your local computer.
Yes, it's correct, for use read Help in Extensions -> Plugins

Alby

Re: template using JS expanding and contracting content

Posted: Sun Jan 20, 2008 9:25 pm
by Dr.CSS
I was under the impression that the plugin came with the default install, it's used in the comments module, in fact I just looked and they both come with it...

Look in the extensions > tags section of the admin...

Re: template using JS expanding and contracting content

Posted: Mon Jan 21, 2008 2:41 pm
by Tracy
So, sorry for being such a beginer :-\er but, if it comes with this plugin then the page I already built using javascript??? Does the plugin just help the JS work or what happens.

I don't understand.

Re: template using JS expanding and contracting content

Posted: Mon Jan 21, 2008 5:15 pm
by Tracy
???Ok, now I'm confused. I've read my replies here and found the {startExpandCollapse} {stopExpandCollapse} as mentioned. Redid my template only using this and have removed my Javascript source. It is working fine but my question now is in making the template so that the client can add his own Questions, Responses and Titles. Using the {startExpandCollapse} {stopExpandCollapse} each expanding heading that is clicked needs to be given a unique "id" and "title" so how do I put this in the template?? Maybe I'm not building the templates correctly. I want to leave the Q & Rs he has to date and add additional ones in the future.

Re: template using JS expanding and contracting content

Posted: Mon Jan 21, 2008 5:33 pm
by alby
Tracy wrote: ???Ok, now I'm confused. I've read my replies here and found the {startExpandCollapse} {stopExpandCollapse} as mentioned. Redid my template only using this and have removed my Javascript source. It is working fine but my question now is in making the template so that the client can add his own Questions, Responses and Titles. Using the {startExpandCollapse} {stopExpandCollapse} each expanding heading that is clicked needs to be given a unique "id" and "title" so how do I put this in the template?? Maybe I'm not building the templates correctly. I want to leave the Q & Rs he has to date and add additional ones in the future.
My mistake, I don't read all reply.
My advice is to put the code in content of the page and not in the template.
Your client edit this content page and not template and insert text and code:

{startExpandCollapse id="QR1" title="YYYY"}
.......................
{stopExpandCollapse}

{startExpandCollapse id="QR2" title="YYYY"}
.......................
{stopExpandCollapse}


Alby

Re: template using JS expanding and contracting content

Posted: Mon Jan 21, 2008 5:48 pm
by calguy1000
Why not use the questions module or the glossary module for this Q/A thing.... rather than trying to shoehorn something into the content areas of a page.

It'd be alot easier with the questions or glossary module to modify the particular summary templates to do startexpandcollaps, endexpandcollapse with the particular record id

Re: template using JS expanding and contracting content

Posted: Tue Jan 22, 2008 9:00 pm
by Tracy
So will I do anything to the template?

And everytime the client wants to add his new Q & R then he has to actually type in
{startExpandCollapse id="QR1" title="YYYY"}

{stopExpandCollapse}
changing the "id" and the "title" each time? Does it matter if the WYSIWYG is turned on or off?

Re: template using JS expanding and contracting content

Posted: Wed Jan 23, 2008 9:53 am
by alby
Tracy wrote: So will I do anything to the template?

And everytime the client wants to add his new Q & R then he has to actually type in
{startExpandCollapse id="QR1" title="YYYY"}

{stopExpandCollapse}
changing the "id" and the "title" each time? Does it matter if the WYSIWYG is turned on or off?
Yes, not in template (your client should not edit the template) but in page content (add Question text and surround Response text with 2 tags and edit "id" and "title")
Sometimes with WYSIWYG editor can have problems for { }

If your client does not have a minimum of informatic skill, follow the advice of calguy1000, I have not tried (questions module or the glossary module) but probably will have fewer problems in the long term

Alby

Re: template using JS expanding and contracting content

Posted: Thu Jan 24, 2008 7:17 am
by Tracy
Regarding the suggested Questions Module;
I have tried to implement the {startExpandCollapse}{stopExpandCollapse} and although I can make it work I don't think it is the answer that I am looking for, I think the client may have problems writing the content in.

Can you explain to me how the Questions Module works? It is fairly vague in the Forge. Where do I download to and then what. I guess in general I still don't know what to do with modules. 

Also, do you know of any links that I can see what it looks like?

Re: template using JS expanding and contracting content

Posted: Thu Jan 24, 2008 10:07 am
by alby
Tracy wrote: Regarding the suggested Questions Module;
I have tried to implement the {startExpandCollapse}{stopExpandCollapse} and although I can make it work I don't think it is the answer that I am looking for, I think the client may have problems writing the content in.

Can you explain to me how the Questions Module works? It is fairly vague in the Forge. Where do I download to and then what. I guess in general I still don't know what to do with modules. 

Also, do you know of any links that I can see what it looks like?
My advice is always try in local environment if match that you want.
Install xampp and cmsms or a preinstalled 1.2.2

Install module via ModuleManager or follow link module (in prev post), download and install

Alby