Re: Content Placeholders
Mark Leder wrote: > Where would I find something like that? it's already in cfmx (core java anyway). see those links for examples. ~| ColdFusion is delivering applications solutions at at top companies around the world in government. Find out how and where now http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285670 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Content Placeholders
>> in the i18n world, java MessageFormat's are often used for dynamic content like this. it's flexible, quick & as an added bonus handles locale formatting where needed. Where would I find something like that? Mark ~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285669 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Content Placeholders
On 8/7/07, Paul Hastings wrote: > in the i18n world, java MessageFormat's are often used for dynamic content > like > this. it's flexible, quick & as an added bonus handles locale formatting where > needed. Now that's pretty slick! Thanks! ~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285649 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Content Placeholders
in the i18n world, java MessageFormat's are often used for dynamic content like this. it's flexible, quick & as an added bonus handles locale formatting where needed. see: http://www.sustainablegis.com/blog/cfg11n/index.cfm?mode=entry&entry=CEA3E94F-20ED-7DEE-2AFB54B337BC25C6 http://www.sustainablegis.com/blog/cfg11n/index.cfm?mode=entry&entry=E829BC9C-20ED-7DEE-2A52FDB36EC90629 http://www.sustainablegis.com/unicode/resourceBundle/messageFormat.cfm ~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285598 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Content Placeholders
I was just using images as an example. The img tag could be replaced with whatever you wanted. ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Justin Scott [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 07, 2007 10:27 AM To: CF-Talk Subject: RE: Content Placeholders > > > Trying to figure out how to use a placeholder in dynamic content > > > to pull in other content at runtime. > > > > I would approach this by using a regular expression with some > > looping to pull all of variables out of the content and put them > > into a list or array. > > I wouldn't add the overhead of looping and regex finding where it is > totally not needed. Get the selected image record from the database... If you'll remember that the original poster mentioned "dynamic content" which does not specifically mean images. Your solution works fine if you know in advance what the content is going to be (images with numbered IDs), but if you want to be able to use whatever content you like without having to create all of the output in advance, you will find the approach I proposed to be more flexible. In any case, someone on the list will likely benefit from both solutions. -Justin Scott ~| Get involved in the latest ColdFusion discussions, product development sharing, and articles on the Adobe Labs wiki. http://labs/adobe.com/wiki/index.php/ColdFusion_8 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285595 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Content Placeholders
> > > Trying to figure out how to use a placeholder in dynamic > > > content to pull in other content at runtime. > > > > I would approach this by using a regular expression with > > some looping to pull all of variables out of the content > > and put them into a list or array. > > I wouldn't add the overhead of looping and regex finding > where it is totally not needed. Get the selected image > record from the database... If you'll remember that the original poster mentioned "dynamic content" which does not specifically mean images. Your solution works fine if you know in advance what the content is going to be (images with numbered IDs), but if you want to be able to use whatever content you like without having to create all of the output in advance, you will find the approach I proposed to be more flexible. In any case, someone on the list will likely benefit from both solutions. -Justin Scott ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285570 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Content Placeholders
I wouldn't add the overhead of looping and regex finding where it is totally not needed. Get the selected image record from the database... If a qry.column is "" replace **image1** with nothing Else Replace it with Pretty simple... You could also just do it based on whether or not the image file exists... First, Query for the selected image Then... If filexists(imagefile) Replace **imageN** width img tag using imagefile Else Replace **imageN** with nothing Again, pretty simple. Using the "ALL" scope will replace ALL occurrences of each instance you tell it to... no need for looping and searching and extracting and then relooping the extracted content and replacing and putting back... etc... etc... ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Justin Scott [mailto:[EMAIL PROTECTED] Sent: Monday, August 06, 2007 11:22 AM To: CF-Talk Subject: RE: Content Placeholders > Trying to figure out how to use a placeholder in dynamic content to > pull in other content at runtime. I would approach this by using a regular expression with some looping to pull all of variables out of the content and put them into a list or array. Then, you can loop through the results, generate the content for each variable (or discard invalid ones), then replace the variable in the content with the generated content. If you made a recursive process to do the replacements, you could have variables in your generated content as well. -Justin Scott ~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285569 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Content Placeholders
> Trying to figure out how to use a placeholder in > dynamic content to pull in other content at runtime. I would approach this by using a regular expression with some looping to pull all of variables out of the content and put them into a list or array. Then, you can loop through the results, generate the content for each variable (or discard invalid ones), then replace the variable in the content with the generated content. If you made a recursive process to do the replacements, you could have variables in your generated content as well. -Justin Scott ~| Get involved in the latest ColdFusion discussions, product development sharing, and articles on the Adobe Labs wiki. http://labs/adobe.com/wiki/index.php/ColdFusion_8 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285491 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Content Placeholders
And of course if the image is NOT defined, replace **image1** with nothing ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Sunday, August 05, 2007 1:17 PM To: CF-Talk Subject: RE: Content Placeholders I've done this in the past to allow the user to place images at specific places in their articles. I used tokens like... **image1** **image2** **image3** Etc... Then gave them a drop down menu for each image to select which image to display in each position. On the front end... If image1 is defined, #replace(str, '**image1**', '', 'all')# And the same thing for the others. ...:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Mark Leder [mailto:[EMAIL PROTECTED] Sent: Sunday, August 05, 2007 10:19 AM To: CF-Talk Subject: Content Placeholders Hi, Trying to figure out how to use a placeholder in dynamic content to pull in other content at runtime. A user is entering text on a page in a database driven CMS system. If they insert a "token" or "Placeholder" in the middle of the copy somewhere (such as "%%ref01%%"), I would want that placeholder to dynamically insert additional text/graphics copy pulled from a different query, the inserted copy corresponding to that query's "ref01" ID. I could have two or three different "placeholders" within the page, each corresponding to a different "ID". I'm sure something like this is possible, but my searches for "placeholder" and "token" haven't turned up much. Thanks for your assistance, Mark ~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285429 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Content Placeholders
Yeah, I was thinking about some type of conditional logic that would parse the entire html to look for an instance of **image01** to trigger the replace. Mark -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Sunday, August 05, 2007 1:17 PM To: CF-Talk Subject: RE: Content Placeholders I've done this in the past to allow the user to place images at specific places in their articles. I used tokens like... **image1** **image2** **image3** Etc... Then gave them a drop down menu for each image to select which image to display in each position. On the front end... If image1 is defined, #replace(str, '**image1**', '', 'all')# And the same thing for the others. ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285428 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Content Placeholders
I've done this in the past to allow the user to place images at specific places in their articles. I used tokens like... **image1** **image2** **image3** Etc... Then gave them a drop down menu for each image to select which image to display in each position. On the front end... If image1 is defined, #replace(str, '**image1**', '', 'all')# And the same thing for the others. ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Mark Leder [mailto:[EMAIL PROTECTED] Sent: Sunday, August 05, 2007 10:19 AM To: CF-Talk Subject: Content Placeholders Hi, Trying to figure out how to use a placeholder in dynamic content to pull in other content at runtime. A user is entering text on a page in a database driven CMS system. If they insert a "token" or "Placeholder" in the middle of the copy somewhere (such as "%%ref01%%"), I would want that placeholder to dynamically insert additional text/graphics copy pulled from a different query, the inserted copy corresponding to that query's "ref01" ID. I could have two or three different "placeholders" within the page, each corresponding to a different "ID". I'm sure something like this is possible, but my searches for "placeholder" and "token" haven't turned up much. Thanks for your assistance, Mark ~| Get involved in the latest ColdFusion discussions, product development sharing, and articles on the Adobe Labs wiki. http://labs/adobe.com/wiki/index.php/ColdFusion_8 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285426 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Content Placeholders
Hi, Trying to figure out how to use a placeholder in dynamic content to pull in other content at runtime. A user is entering text on a page in a database driven CMS system. If they insert a "token" or "Placeholder" in the middle of the copy somewhere (such as "%%ref01%%"), I would want that placeholder to dynamically insert additional text/graphics copy pulled from a different query, the inserted copy corresponding to that query's "ref01" ID. I could have two or three different "placeholders" within the page, each corresponding to a different "ID". I'm sure something like this is possible, but my searches for "placeholder" and "token" haven't turned up much. Thanks for your assistance, Mark ~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285424 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4