Re: [Hypercontent-users] Editable areas
Brought to you by:
alexvigdor
From: Alex V. <av...@co...> - 2005-01-26 14:46:54
|
Hi Carl, Your main problem is that you're jumping out of context in the = title =20 template: this should fix it: <!--orange box title--> <xsl:template name=3D"rightcolumntitle"/> <xsl:apply-templates select=3D"@title mode=3D"right-box-title"/> </xsl:template> =09 Since each right-box is now wrapped in a "rightcolumn" element, I don't =20= think the modes are necessary any longer: you can apply the box styling =20= at the level of the rightcolumn element rather than the html element, =20= and wind up with simpler XSL: <!-- Main page template--> <xsl:template match=3D"/"> <xsl:choose> <xsl:when test=3D"string-length($rightboxlen)!=3D0"> <xsl:apply-templates select=3D"/cms:wrapper/cms:source/page/rightcolumn"/>= </xsl:when> <xsl:otherwise> <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <!--orange box text--> <xsl:template match=3D"rightcolumn"> <div class=3D"right-box"> <div class=3D"right-box-title"> <xsl:value-of select=3D"@title"/>=09 </div> <div class=3D"right-box-body"> <xsl:apply-templates select=3D"html"/> </div> </div> </xsl:template> -Alex On Jan 26, 2005, at 4:37 AM, Carl Barrow wrote: > Yeah sure, here=92s the basics from the template. If you want my full =20= > template sending over then I can do that. > > <!-- Main page template--> > <xsl:template match=3D"/"> > <xsl:choose> > <xsl:when test=3D"string-length($rightboxlen)!=3D0"> > <xsl:call-template name=3D"rightcolumn"/> > </xsl:when> > <xsl:otherwise> > <xsl:text> </xsl:text> > </xsl:otherwise> > </xsl:choose> > </xsl:template> > > <!--orange box text--> > <xsl:template name=3D"rightcolumn"> > <xsl:apply-templates =20 > select=3D"/cms:wrapper/cms:source/page/rightcolumn/html =20 > mode=3D"right-box"/> > </xsl:template> > > <!--orange box title--> > <xsl:call-template name=3D"rightcolumntitle"/> > <xsl:apply-templates =20 > select=3D"/cms:wrapper/cms:source/page/rightcolumn/@title =20 > mode=3D"right-box-title"/> > </xsl:template> > > <!--orange box mode--> > <xsl:template match=3D"html" mode=3D"right-box"> > <xsl:call-template name=3D"rightcolumntitle"/> > <xsl:apply-templates select=3D"."/> > </xsl:template> > > <!--orange box title mode--> > <xsl:template match=3D"html" mode=3D"right-box-title"> > <xsl:apply-templates select=3D"."/> > </xsl:template> > > Thanks > Carl > > > > Alex Vigdor wrote: > >> Carl, >> Could you send along the XSL you're applying to this XML? That will =20= >> make it easier to understand what might be going wrong. >> >> Alex >> >> On Jan 25, 2005, at 6:02 AM, Carl Barrow wrote: >> >>> Thanks very much for that, all working fine. I have changed things a = =20 >>> little and set a title on a repeating rightcoloumn element : >>> >>> <!ELEMENT page (rightcolumn*,bodytext,leftcolumn?)> >>> <!ELEMENT rightcolumn (html)> >>> <!ELEMENT bodytext (html)> >>> <!ELEMENT leftcolumn (html)> >>> <!ATTLIST rightcolumn title CDATA #REQUIRED> >>> >>> I have tried to get the titles into each box but have been having =20= >>> trouble. It ether displayed the last one in all the boxes or it =20 >>> displayed all the tiles above the boxes. Any Pointers on this? >>> >>> Thanks >>> Carl >>> >>> Alex Vigdor wrote: >>> >>>> Hi Carl, >>>> The trick here is that your right boxes are stored in html =20 >>>> elements, which are also used in different contexts in the =20 >>>> document. XSL provides the notion of "modes" on templates to allow =20= >>>> you to different things with the same elements in different =20 >>>> contexts. I.e. >>>> >>>> <xsl:template name=3D"rightcolumn"> >>>> <xsl:apply-templates =20 >>>> select=3D"/cms:wrapper/cms:source/page/rightcolumn/html" =20 >>>> mode=3D"right-box"/> >>>> </xsl:template> >>>> >>>> <xsl:template match=3D"html" mode=3D"right-box"> >>>> <!-- do whatever creates the visual box --> >>>> <div class=3D"right-box-style"> >>>> <!-- this will pass through to the original, non-moded html =20 >>>> template to generate the box contents --> >>>> <xsl:apply-templates select=3D"."/> >>>> </div> >>>> </xsl:template> >>>> >>>> Alex >>>> >>>> On Jan 21, 2005, at 6:19 AM, Carl Barrow wrote: >>>> >>>>> Alex/Adam >>>>> >>>>> Thanks very much. I have a repeating element for the right boxs in = =20 >>>>> there and it allows the users to add as many as they want at the =20= >>>>> moment, I haven't decided weather I'am going to restrict them, =20 >>>>> although I think it might be wise. >>>>> >>>>> My DTD for the full page content is : >>>>> <!ELEMENT page (rightboxes,bodytext,leftcolumn?)> >>>>> <!ELEMENT rightboxes (html*)> >>>>> <!ELEMENT bodytext (html)> >>>>> <!ELEMENT leftcolumn (html)> >>>>> <!ATTLIST bodytext CDATA #REQUIRED> >>>>> >>>>> In my template I have a variable that contains the content of =20 >>>>> rightbox/html : >>>>> <xsl:variable name=3D"rightboxlen" =20 >>>>> select=3D"/cms:wrapper/cms:source/page/rightbox/html" /> >>>>> >>>>> I then check if that is not 0 and put the box in there : >>>>> <xsl:choose> >>>>> <xsl:when test=3D"string-length($rightboxlen)=3D!0"> >>>>> <xsl:call-template name=3D"rightcolumn"/> >>>>> </xsl:when> >>>>> <xsl:otherwise> >>>>> <xsl:text> </xsl:text> >>>>> </xsl:otherwise> >>>>> </xsl:choose> >>>>> >>>>> The rightcolum template being (taking out html): >>>>> <xsl:template name=3D"rightcolumn"> >>>>> <xsl:apply-templates =20 >>>>> select=3D"/cms:wrapper/cms:source/page/rightcolumn/html"/> >>>>> <xsl:if test=3D"$filedate"> >>>>> >>>>> All works fine....apart from the fact that it puts all the html =20= >>>>> elements for rightbox is the same box on the page. I can see why =20= >>>>> it's doing that but I can't figure out how to get them in separate = =20 >>>>> boxes. >>>>> >>>>> Can you help with that at all? >>>>> >>>>> Thanks for all you help >>>>> Carl >>>>> >>>>> >>>>> At the moment, I'm checking if the >>>>> >>>>> Alex Vigdor wrote: >>>>> >>>>>> Well, you could limit it to 3 by explicitly declaring each as a =20= >>>>>> separate element: >>>>>> >>>>>> <!ELEMENT page (html,right-box1*,right-box2*,right-box3*)> >>>>>> >>>>>> It makes for a less appealing DTD, but allows you to keep users =20= >>>>>> from trying to add a hundred boxes to a page . . . >>>>>> >>>>>> Alex >>>>>> >>>>>> On Jan 20, 2005, at 11:13 AM, Adam Carl wrote: >>>>>> >>>>>>> Carl, >>>>>>> >>>>>>> There is no way using the current interface to do the following: >>>>>>> >>>>>>> " So for example, for the right hand orange boxes the user might = =20 >>>>>>> be presented with an option to add 0-3 boxes, then on selection =20= >>>>>>> have the editable text appear for each box." >>>>>>> >>>>>>> The standard interface is not that flexible. >>>>>>> >>>>>>> You could give them the option to add one or more right hand =20 >>>>>>> boxes by setting up a dtd. Alex had a good example. >>>>>>> >>>>>>>>> <!ELEMENT page (html,right-box*)> >>>>>>>>> <!ELEMENT right-box(html)> >>>>>>>>> <!ATTLIST right-box title CDATA #REQUIRED> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> You could also set it up like this: >>>>>>> >>>>>>>>> <!ELEMENT page (html,right-boxes)> >>>>>>>>> <!ELEMENT right-boxes(html*)> >>>>>>>>> <!ATTLIST right-box title CDATA #REQUIRED> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> This way every html area in the right-boxes element was its own =20= >>>>>>> Information html section. Ahh but the problem here would be =20 >>>>>>> having a title for each. >>>>>>> >>>>>>> >>>>>>> Adam >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Jan 20, 2005, at 4:05 AM, Carl Barrow wrote: >>>>>>> >>>>>>>> Hi Adam >>>>>>>> >>>>>>>> If you have any further pointers on this that would be great. =20= >>>>>>>> It would really finish of what I've been getting setup here. >>>>>>>> >>>>>>>> Thanks >>>>>>>> Carl >>>>>>>> >>>>>>>> Alex Vigdor wrote: >>>>>>>> >>>>>>>>> Hi Carl, >>>>>>>>> We do something almost identical to what you are describing on = =20 >>>>>>>>> one of our latest sites >>>>>>>>> >>>>>>>>> http://www.columbia.edu/hr/index.html >>>>>>>>> >>>>>>>>> If you navigate across the top-level pages you'll notice that =20= >>>>>>>>> each of them has a slightly different box arrangement. Adam =20= >>>>>>>>> should be able to describe the implementation in more detail, =20= >>>>>>>>> but I believe in XML you could just have a repeating element =20= >>>>>>>>> "right-box" with a single child "html" and an attribute for =20= >>>>>>>>> its title, and in XSL and/or CSS you could set up the actual =20= >>>>>>>>> on-screen positioning. E.g. >>>>>>>>> >>>>>>>>> <!ELEMENT page (html,right-box*)> >>>>>>>>> <!ELEMENT right-box(html)> >>>>>>>>> <!ATTLIST right-box title CDATA #REQUIRED> >>>>>>>>> >>>>>>>>> and call different templates with "/page/html" vs. =20 >>>>>>>>> "/page/right-box/html". >>>>>>>>> >>>>>>>>> Alex >>>>>>>>> >>>>>>>>> On Jan 19, 2005, at 9:51 AM, Carl Barrow wrote: >>>>>>>>> >>>>>>>>>> Hi Alex >>>>>>>>>> >>>>>>>>>> Thanks for the info on downloads. I'll leave things as they =20= >>>>>>>>>> are and have a look at getting updated to v2 when it's =20 >>>>>>>>>> released. >>>>>>>>>> >>>>>>>>>> I have a question which might not be possible. If you take a =20= >>>>>>>>>> look at the sample page =20 >>>>>>>>>> http://www.learndev.hull.ac.uk/CB/REOTESTPAGE.html you will =20= >>>>>>>>>> notice that I have info boxes down the right hand side of the = =20 >>>>>>>>>> page and under the menu items on the left. At the moment I am = =20 >>>>>>>>>> dropping these boxes into editable areas in html form which =20= >>>>>>>>>> works great for me but might not for some of the users on =20 >>>>>>>>>> campus. Is there any way ether now or in future releases of =20= >>>>>>>>>> HyperContent that a user could add as many boxes as the =20 >>>>>>>>>> wanted but not have to worry about any html? So for example, =20= >>>>>>>>>> for the right hand orange boxes the user might be presented =20= >>>>>>>>>> with an option to add 0-3 boxes, then on selection have the =20= >>>>>>>>>> editable text appear for each box. >>>>>>>>>> >>>>>>>>>> Just something that I thought about..... >>>>>>>>>> >>>>>>>>>> Many thanks >>>>>>>>>> Carl >>>>>>>>>> >>>>>>>>>> -- =20 >>>>>>>>>> ************************************ >>>>>>>>>> >>>>>>>>>> Carl Barrow >>>>>>>>>> Web Developer >>>>>>>>>> e-Services >>>>>>>>>> The University of Hull >>>>>>>>>> Cottingham Road >>>>>>>>>> Hull >>>>>>>>>> HU6 7RX >>>>>>>>>> Ext. 6838 >>>>>>>>>> ************************************ >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> ------------------------------------------------------- >>>>>>>>>> The SF.Net email is sponsored by: Beat the post-holiday blues >>>>>>>>>> Get a FREE limited edition SourceForge.net t-shirt from =20 >>>>>>>>>> ThinkGeek. >>>>>>>>>> It's fun and FREE -- well, =20 >>>>>>>>>> almost....http://www.thinkgeek.com/sfshirt >>>>>>>>>> _______________________________________________ >>>>>>>>>> Hypercontent-users mailing list >>>>>>>>>> Hyp...@li... >>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/hypercontent-=20 >>>>>>>>>> users >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> ------------------------------------------------------- >>>>>>>>> The SF.Net email is sponsored by: Beat the post-holiday blues >>>>>>>>> Get a FREE limited edition SourceForge.net t-shirt from =20 >>>>>>>>> ThinkGeek. >>>>>>>>> It's fun and FREE -- well, =20 >>>>>>>>> almost....http://www.thinkgeek.com/sfshirt >>>>>>>>> _______________________________________________ >>>>>>>>> Hypercontent-users mailing list >>>>>>>>> Hyp...@li... >>>>>>>>> = https://lists.sourceforge.net/lists/listinfo/hypercontent-users >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> --=20 >>>>>>>> ************************************ >>>>>>>> >>>>>>>> Carl Barrow >>>>>>>> Web Developer >>>>>>>> e-Services >>>>>>>> The University of Hull >>>>>>>> Cottingham Road >>>>>>>> Hull >>>>>>>> HU6 7RX >>>>>>>> Ext. 6838 >>>>>>>> ************************************ >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> ------------------------------------------------------- >>>>>>>> This SF.Net email is sponsored by: IntelliVIEW -- Interactive =20= >>>>>>>> Reporting >>>>>>>> Tool for open source databases. Create drag-&-drop reports. =20 >>>>>>>> Save time >>>>>>>> by over 75%! Publish reports on the web. Export to DOC, XLS, =20= >>>>>>>> RTF, etc. >>>>>>>> Download a FREE copy at http://www.intelliview.com/go/osdn_nl >>>>>>>> _______________________________________________ >>>>>>>> Hypercontent-users mailing list >>>>>>>> Hyp...@li... >>>>>>>> https://lists.sourceforge.net/lists/listinfo/hypercontent-users >>>>>>>> >>>>>>> Adam Carl >>>>>>> AIS Web Services >>>>>>> (212) 854-0131 >>>>>>> ac...@co... >>>>>>> >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------- >>>>>>> This SF.Net email is sponsored by: IntelliVIEW -- Interactive =20= >>>>>>> Reporting >>>>>>> Tool for open source databases. Create drag-&-drop reports. Save = =20 >>>>>>> time >>>>>>> by over 75%! Publish reports on the web. Export to DOC, XLS, =20 >>>>>>> RTF, etc. >>>>>>> Download a FREE copy at http://www.intelliview.com/go/osdn_nl >>>>>>> _______________________________________________ >>>>>>> Hypercontent-users mailing list >>>>>>> Hyp...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/hypercontent-users >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> ------------------------------------------------------- >>>>>> This SF.Net email is sponsored by: IntelliVIEW -- Interactive =20 >>>>>> Reporting >>>>>> Tool for open source databases. Create drag-&-drop reports. Save =20= >>>>>> time >>>>>> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, = =20 >>>>>> etc. >>>>>> Download a FREE copy at http://www.intelliview.com/go/osdn_nl >>>>>> _______________________________________________ >>>>>> Hypercontent-users mailing list >>>>>> Hyp...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/hypercontent-users >>>>> >>>>> >>>>> >>>>> >>>>> --=20 >>>>> ************************************ >>>>> >>>>> Carl Barrow >>>>> Web Developer >>>>> e-Services >>>>> The University of Hull >>>>> Cottingham Road >>>>> Hull >>>>> HU6 7RX >>>>> Ext. 6838 >>>>> ************************************ >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------- >>>>> This SF.Net email is sponsored by: IntelliVIEW -- Interactive =20 >>>>> Reporting >>>>> Tool for open source databases. Create drag-&-drop reports. Save =20= >>>>> time >>>>> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, =20= >>>>> etc. >>>>> Download a FREE copy at http://www.intelliview.com/go/osdn_nl >>>>> _______________________________________________ >>>>> Hypercontent-users mailing list >>>>> Hyp...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/hypercontent-users >>>> >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> This SF.Net email is sponsored by: IntelliVIEW -- Interactive =20 >>>> Reporting >>>> Tool for open source databases. Create drag-&-drop reports. Save =20= >>>> time >>>> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, =20= >>>> etc. >>>> Download a FREE copy at http://www.intelliview.com/go/osdn_nl >>>> _______________________________________________ >>>> Hypercontent-users mailing list >>>> Hyp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/hypercontent-users >>> >>> >>> >>> --=20 >>> ************************************ >>> >>> Carl Barrow >>> Web Developer >>> e-Services >>> The University of Hull >>> Cottingham Road >>> Hull >>> HU6 7RX >>> Ext. 6838 >>> ************************************ >>> >>> >>> >>> ------------------------------------------------------- >>> This SF.Net email is sponsored by: IntelliVIEW -- Interactive =20 >>> Reporting >>> Tool for open source databases. Create drag-&-drop reports. Save = time >>> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, =20= >>> etc. >>> Download a FREE copy at http://www.intelliview.com/go/osdn_nl >>> _______________________________________________ >>> Hypercontent-users mailing list >>> Hyp...@li... >>> https://lists.sourceforge.net/lists/listinfo/hypercontent-users >>> >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: IntelliVIEW -- Interactive =20 >> Reporting >> Tool for open source databases. Create drag-&-drop reports. Save time >> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, = etc. >> Download a FREE copy at http://www.intelliview.com/go/osdn_nl >> _______________________________________________ >> Hypercontent-users mailing list >> Hyp...@li... >> https://lists.sourceforge.net/lists/listinfo/hypercontent-users > > > --=20 > ************************************ > > Carl Barrow > Web Developer > e-Services > The University of Hull > Cottingham Road > Hull > HU6 7RX > Ext. 6838 > ************************************ > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive = Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Hypercontent-users mailing list > Hyp...@li... > https://lists.sourceforge.net/lists/listinfo/hypercontent-users |