How to Create Dynamic Content Display Objects in Mura CMS with MuraFW1 Plugins

If you've ever created a MuraFW1 plugin for Mura CMS (which this article assumes by the way!), you may have wondered how to go about creating dynamic Content Display Objects. Doing so would enable an end-user to edit a page, go to the Content Objects tab, select Plugins from the Available Content Objects dropdown, select your plugin, then select your "dynamic display object" which would then fire off and return yet form field containing the dynamic list of options available to be assigned to the desired content display region.

Still with me? Great!

Ultimately, there's three main parts to this:

1. Create the display method, i.e., myDisplay

2. Then create an "OptionsRender" display method which follows the naming convention of myDisplayOptionsRender

3. Finally, we'll add the basic display method (i.e., myDisplay) to the config.xml.cfm's list of available displayObjects

1. Create The Display Method

In the pluginEventHandler.cfc, we can add our basic display method. Ultimately, we should eventually expect a JSON formatted variable to be passed in via $.event('params'). Obviously, we'll need to deserialize the JSON, and once we do that, we can do whatever we like with it. An easy way to pass this information over to FW/1 is to stuff any desired variables into the URL scope ... and then call the typical renderApp() method and let FW/1 take over from there. Check out our simple example below which is expecting to find "whateverID" to be in the unpacked params:

<cffunction name="dspWhatever" output="false" returntype="any">
    <cfargument name="$" hint="mura scope" />
    <cfscript>
        var local = {};

        // grab everything that's been passed in from OptionsRender() and unpack the JSON option values that were saved
        local.params = DeserializeJSON($.event('params'));

        // stuff selected WhateverID into the url scope so that fw1 will pick it up
        if ( StructKeyExists(local.params, 'whateverid') ) {
            url.whateverid = local.params.whateverid;
        };

        // something went wrong ... so let's not bomb everything
        if ( not StructKeyExists(url, 'whateverid') ) {
            return '';
        } else {
            return renderApp($,'public:main.default');
        };
    
</cfscript>
</cffunction>

2. Create An "OptionsRender" Method

Now for the magical part! Whatever you named your displayMethod, you simply append "OptionsRender" to the end of it. So if you have dspWidgets, then you would have dspWidgetsOptionsRender as an available method. In the example below, I'm creating a simple recordset which we'll then loop over to output the options and dynamically generate the option value which is a tilde (~) separated list where the last item in the list is a JSON formatted list of params...yes, the very same params our display method in step one is expecting to find!

<cffunction name="dspWhateverOptionsRender" output="false" returntype="any">
    <cfargument name="$" />
    <cfscript>
        var local = {};
        
        // this recordset could come from anywhere ... doesn't even have to be a recordset, could be anything that contains data that you want to grab options from
        local.rs = QueryNew('WhateverID,WhateverTitle,WhateverField', 'VarChar,VarChar,VarChar');

        QueryAddRow(local.rs, 1);
        QuerySetCell(local.rs,'WhateverID', 'anyid-1', 1);
        QuerySetCell(local.rs,'WhateverTitle', 'My Awesome Title', 1);
        QuerySetCell(local.rs, 'WhateverField', 'Hi Ho Cherry-O', 1);

        QueryAddRow(local.rs, 1);
        QuerySetCell(local.rs, 'WhateverID', 'anyid-2', 2);
        QuerySetCell(local.rs, 'WhateverTitle', 'Another Great Title', 2);
        QuerySetCell(local.rs, 'WhateverField', 'Knick Knack Paddy Whack', 2);
    
</cfscript>
    <cfsavecontent variable="local.str">
        <cfif local.rs.recordcount>
            <select name="availableObjects" id="availableObjects" class="dropdown">
                <!--- we're going to pack everything up into a tilde (~) separated list where the last item in the is a JSON formatted list of params to be passed over to the display method --->
                <cfoutput query="local.rs">
                    <option value="plugin~#HTMLEditFormat(Replace(WhateverTitle,'~','','ALL'))#~#$.event('objectid')#~{'whateverid':'#WhateverID#','anotherfield':'#WhateverField#'}">
                        #HTMLEditFormat(WhateverTitle)#
                    </option>
                </cfoutput>
            </select>
        <cfelse>
            <p><em>Please create some Whatevers first.</em></p>
        </cfif>
    </cfsavecontent>
    <cfreturn local.str />
</cffunction>

3. Add The Rendering Method To config.xml.cfm

The final step in all this is to add your basic displayMethod to your config.xml.cfm file so that it will be registered with Mura CMS. Once it is, then we should expect to see it show up in the Content Objects tab when someone selects our plugin.

<displayobjects location="global">
    <displayobject name="Display Whatever" displaymethod="dspWhatever" component="pluginEventHandler" persist="false" />
</displayobjects>

That's it! Hopefully this helps anyone else who is creating FW/1 plugins for Mura CMS.

Cheers!

Comments
Nice post steve. Very similar to Grant Shepery post here that i have used to create a custom image gallery.

http://www.grantshepert.com/post.cfm/advanced-plug...

But your post is an excellent addition.
# Posted By jbuda | 8/31/11 8:43 AM
@jbuda,

yeah, he had a great post on this topic. one point i wanted to illustrate is that it's possible to do this without actually having to modify the MuraFW1 plugin's renderApp() method ... it's very easy to just stuff anything the plugin is already listening for into the url scope, etc. so that fw1 will just pick it up and respond if necessary.

cheers!
# Posted By Steve Withington | 8/31/11 9:01 AM
Great Post! Any thoughts on how you'd pass in a list of Content Collections, so that the user can simply choose the content collection they'd want to use for the specific plugin? I have a slider plugin that just takes an ID to get the collection to pass into, and it would be ideal if i can have that ID be automated a bit, so that the user could pick, and put that slider on many different pages, using many different content collections.

I'll poke around your site and Grant's more to find the answer to my own question, but if you can i'd appreciate any suggested approach.

All the best,
David
# Posted By David Panzarella | 8/31/11 10:53 AM
Great post, thanks!
# Posted By Sean Walsh | 8/31/11 11:03 AM
Iam not talking about dynamic display object here- rather my issue is how to create a simple displayobject on our MURAFW1 plugin.

I want to call public:dept.list from the below displayobject
<displayobject name="depList" displaymethod="renderApp(action='public:dept.list')" component="pluginEventHandler" persist="false" />
But I get only errors:

"    Ensure that the method is defined, and that it is spelled correctly.
Message    The method renderApp(action='public:dept.list') was not found in component D:\Zend\Apache2\htdocs\learnMura.loc\plugins\muraFW1\pluginEventHandler.cfc."

Actually list method on dept controller exists.
# Posted By Shimju David | 4/4/12 10:20 PM
@Shimju,

Sorry for the delay, I was on vacation and had limited access to internet.

Anyway, in your case, simply create a method in the pluginEventHandler.cfc called something like "dspDepList" which returns renderApp(action='public:dep.list')

For example:
<displayobject name="depList" displaymethod="dspDepList" component="pluginEventHandler" persist="false" />

Then,
<cffunction name="dspDepList">
<cfreturn renderApp(action='public:dep.list') />
</cffunction>

Hope that helps!
# Posted By Steve Withington | 4/11/12 9:22 AM
In the event that you have been presented with any kind of web programming, you are most likely comfortable with the dialects JavaScript and PHP. Not at all like HTML which is a static programming dialect, these dialects are what we call dynamic programming dialects since they enable you to perform dynamic capacities on your website pages.
# Posted By Assignment Help Service | 3/29/18 6:28 AM
Infused with http://www.replicawatchess.uk.com the brand's vitality into http://www.replicawatchesshop.co.uk the brand's traditional http://www.bestukwatches.co.uk watchmaking classics, it left a http://www.rolexsreplicas.org.uk deep impression.
# Posted By rolex replica | 7/23/18 2:05 AM
I’m really impressed with your article, such great & usefull knowledge you mentioned here
# Posted By Accounting Managerial Writing Service | 9/28/18 6:04 AM
easy hairstyles for short hair for school chrome --disable-extensions https://www.humanhairwig.org.uk scunci faux hair extensions elva lace wigs https://www.cheaphairforextensions.co.uk virgin hair uk quad weft one piece hair extensions https://www.moptopz.co.uk ayurvedic oil for black hair tape hair extensions newcastle https://www.wigsandclips.co.uk wigs online $50 human lace front wigs https://www.hair-extensions2go.co.uk
# Posted By vsvs | 10/11/18 11:20 PM
It's simply extraordinary pages and you require PHP just for formats. On the off chance that you need not to reload the page, you need to utilize javascript and supplant the HTML in that div, yet for this situation, all the conceivable substitutions must be downloaded or you'd have to utilize ajax.
Nice sharing amazing one keep sharing more thanks for all lovely one
# Posted By China pharma manufacturer | 8/1/19 2:29 PM
PayMyDoctor is a successful online entrance that enables you to make installments on the web. This is an entryway overseen by Allscripts Healthcare Solutions.

https://penzu.com/public/b04cd1d0
http://mcdsurvey.mystrikingly.com/blog/walgreensli...
https://mcdvoicesurvey.food.blog/2019/08/16/paymyd...
# Posted By paymydoctor | 8/21/19 4:54 AM
I read your blog post and this is nice blog post.. thanks for taking the time to share with us. have a nice day
# Posted By China pharma manufacturer | 8/30/19 11:40 AM
This Is Really Great Work. Thank You For Sharing Such A Good And Useful Information Here In The Blog
# Posted By canadian slipcovers | 9/5/19 8:47 PM
I am happy to find this post Very useful for me, as it contains lot of information. I Always prefer to read The Quality and glad I found this thing in you post. Thanks
# Posted By Berlin marathon results | 9/13/19 10:39 AM
I am happy to find this post Very useful for me, as it contains lot of information. I Always prefer to read The Quality and glad I found this thing in you post. Thanks
# Posted By mmPersonalLoans offer loans no credit check | 9/21/19 12:56 PM
I am happy to find this post Very useful for me, as it contains lot of information. I Always prefer to read The Quality and glad I found this thing in you post. Thanks
# Posted By mmPersonalLoans offer loans no credit check | 9/21/19 12:56 PM
I am happy to find this post Very useful for me, as it contains lot of information. I Always prefer to read The Quality and glad I found this thing in you post. Thanks
# Posted By mmPersonalLoans offer loans no credit check | 9/21/19 12:56 PM
I gotta favorite this website it seems very helpful .
# Posted By 500 loans online by United Finances | 10/2/19 9:53 AM
Thanks for the blog filled with so many information. Stopping by your blog helped me to get what I was looking for. Now my task has become as easy as ABC.
# Posted By UnitedFinances offer $1000 loan | 10/3/19 2:37 PM
it was a wonderful chance to visit this kind of site and I am happy to know. thank you so much for giving us a chance to have this opportunity..
# Posted By Buy website Traffic | 10/9/19 9:58 PM
Very good points you wrote here..Great stuff...I think you've made some truly interesting points.Keep up the good work.
# Posted By remembrance sunday poems | 10/11/19 6:16 AM
Thanks so much for this information. I have to let you know I concur on several of the points you make here and others may require some further review, but I can see your viewpoint.   <a href="https://blogautomobile.fr/porsche-panamera-s-va-co...;
I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
# Posted By remembrance sunday parade | 10/14/19 10:29 AM
Very good points you wrote here..Great stuff...I think you've made some truly interesting points.Keep up the good work.
# Posted By http://palavrastemporarias.blogspot.com/2012/11/ | 10/17/19 10:05 PM
Very good points you wrote here..Great stuff...I think you've made some truly interesting points.Keep up the good work.
# Posted By talk to strangers | 10/23/19 10:08 PM
Very good points you wrote here..Great stuff...I think you've made some truly interesting points.Keep up the good work.
# Posted By talk to strangers | 11/5/19 1:02 AM
Very good points you wrote here..Great stuff...I think you've made some truly interesting points.Keep up the good work.
# Posted By talk to strangers | 11/11/19 8:47 PM
Great Information sharing .. I am very happy to read this article .. thanks for giving us go through info.Fantastic nice. I appreciate this post.
# Posted By talk to strangers | 11/17/19 4:58 AM
You have learnt us how to create a dynamic display object in Mura CMS with Mura FW1 plugin. Well, this plugin I didn't use it until.

# Posted By jon danzy | 12/17/19 5:33 AM
I did not use this plugin before.
# Posted By Dissertation Writing Services | 1/20/20 2:18 AM
www.google.com" target="_blank">https://www.google.com <a href="www.google.com" target="_blank">https://www.google.com">sixer</a> [url=www.google.com]BB[/url] keyword
# Posted By charlibilson | 6/5/20 5:50 AM
www.google.com" target="_blank">https://www.google.com <a href="www.google.com" target="_blank">https://www.google.com">sixer</a> [url=www.google.com]BB[/url] keyword
# Posted By charlibilson | 6/5/20 5:51 AM
Best Fish Finders For The Money 2020
Garmin Striker 4 Built-in GPS Fish Finder, is found to be one of the best fish finder brand GPS. It’s comparatively small with other fish finders but still, it does its job perfectly. Each and everything will be clear to you due to its high colour contrasts and brightness. The good thing about it is you can mark your hot spots to make fish catching easier for you regardless of whether you are in open water or in the lake.
https://bestfishfinderreviewz.com/
# Posted By jibran ahmed | 7/25/20 7:41 AM
Best Water Based Polyurethane For Floors 2020
Bona Mega Wood Floor Finish, is a floor finish specially designed for wood floors. RUST-OLEUM Varathane Enhancing the natural beauty of the floor and retaining its original color, it provides maximum shine and makes your floor look good as new. This is a clear liquid that gives extraordinary clean and clear finish to the floors leaving it bright and sparkly.
http://waterbasedpolyurethane.com/

# Posted By jibran ahmed | 7/25/20 7:42 AM
Best Spray Tan Solution 2020
A best spray tan solution, is a method of giving you tanned skin for several days, without having to reveal yourself to deadly UV light as you would in a tanning salon or by sunbathing. There are several primary qualities that a tanning solution should have so that you attain natural-looking coverage and a great tanned color that not only shines up your complexion but also persists for a pretty long time .Sunless tanners are available in lotion, gel, spray, powder, and mousse. There are also staged tanners for deeper and longer-lasting results.
http://spraytansolutionreview.com/

# Posted By jibran ahmed | 7/25/20 7:42 AM
Best SEO Agency in Pakistan
Digisiz offers complete range of online marketing services including SEO, SMO & PPC. We are working in Italy and Pakistan and had a proven record in the field of Digital Marketing. We have been working in the field of Online Marketing for the last 5 to 6 years. We can help you get better exposure for your products & campaigns. Improve your digital presence positively engage with your community.
https://www.digisiz.com/
# Posted By jibran ahmed | 7/25/20 7:43 AM
Best Jurassic World Alive Game 2020
The game story is all about dinosaurs on an unstable island. In the Jurassic world, they can freely move, and we have to hunt them and collect their DNA .The fusion of dinosaurs can boost the level of players.The number of resources offered in Jurassic world alive game in the result of rewards like bucks, darts, coins, incubator.Artificial intelligence used to communicate dinosaurs and the sci fictions ideas make every efforts to clone dinosaurs..
http://Jurassicworldalivehack.com
# Posted By jibran ahmed | 7/25/20 7:44 AM
Best Darkness Rises Game 2020
Darkness Rises is a mobile game that is available on both Android and iOS. Darkness rises is the third chapter of the great Dark Avengers series brought to you by NEXON. The aim of the game is to use one of the many playable classes and back against an army of devils! This lone Action RPG blends amazing graphics with an intense story to form a game unlike any other.
https://www.darknessrisesgame.com/

# Posted By jibran ahmed | 7/25/20 7:44 AM
US OPEN
US Open Tennis Kenin: On the WTA side, the year was off to a great start, as we saw a new Grand Slam champion in Sofia Kenin. Kenin won the final in Melbourne after defeating Garbine Muguruza. Many are expecting great things from the American and she has now made her intentions for the US Open known.
https://etandoz.com/category/us-open/
# Posted By jibran ahmed | 8/15/20 7:47 AM
US OPEN
US Open Tennis Kenin: On the WTA side, the year was off to a great start, as we saw a new Grand Slam champion in Sofia Kenin. Kenin won the final in Melbourne after defeating Garbine Muguruza. Many are expecting great things from the American and she has now made her intentions for the US Open known.
https://etandoz.com/category/us-open/
# Posted By jibran ahmed | 8/15/20 7:52 AM
US OPEN
US Open Tennis Kenin: On the WTA side, the year was off to a great start, as we saw a new Grand Slam champion in Sofia Kenin. Kenin won the final in Melbourne after defeating Garbine Muguruza. Many are expecting great things from the American and she has now made her intentions for the US Open known.
https://etandoz.com/category/us-open/
# Posted By jibran ahmed | 8/15/20 7:52 AM
US 0PEN2020
US Open Tennis Finalists The US Open is a Grand Slam tennis competition held in New York City at the USTA Billie Jean King National Tennis Center in the zone of Flushing Meadows. In 1968, this competition got open to experts and has been referred to from that point forward as the US Open.
https://www.viralhub24.com/us-open-2020/
# Posted By jibran ahmed | 8/15/20 7:53 AM
That is really nice to hear. thank you for the update and good luck.   <a href="https://www.amazon.com/Sifter-Baking-Stainless-Dou... sifter near me</a>
# Posted By flour sifter near me | 12/4/20 5:47 AM
Plugins from the Available Content Objects dropdown, select your plugin, then select your "dynamic display object" which would then fire off and return yet form field containing the dynamic
http://fanee.in/
http://www.escortgirlsgurgaon.in/
# Posted By Escorts in Bangalore | 12/26/20 12:47 PM
Everything has its value. Thanks for sharing this informative information with us. GOOD works!
# Posted By backscratchers amazon | 1/11/21 9:56 AM
Get Model Sexy Escorts Viva StreetThen Contact Arpita Jain@ 9004458359 Meeting an ideal feminine companion and transfer them with you to pay night has become very easy. Adolescent escort in city offers you with the foremost tempting and dangerous pleasance in your life. Our independent man believes that each man ought to take the good thing about having a female sex partner. We adolescent Escorts Viva Street is currently a biggest hubs.
# Posted By sweetarpita2 | 1/16/21 7:06 AM


Great article, much obliged for the share. The best thing about modern Healthcare is that it is upgrading every single day, ensuring life saving tactics.

# Posted By Best Doctors in Karachi | 2/27/21 3:30 AM
This write-up says it all. In addition, An individual will not be able to act in accordance with the expected behavior unless experienced. Education should be acquired to tackle all sort of life hacks not just eyeing on certain aspects. Study for ACT
# Posted By Julie Parks | 3/3/21 3:53 AM
If you want to find the net worth and some information about a celebrity, here's the website https://www.celeb-networth.com/ for you.
# Posted By celeb networth | 3/15/21 8:00 AM
Agree with your post, but, numerous folks don’t want to spend their cash on their mental health, assume it to be a minor or a wasteful concern to catch any heed. If that’s so then it is recommended to seek the Therapists that take insurance, they are available to keep an easing hold. <a href="https://hamiltonbehavioralrtms.com/">dbt therapy near me</a>
# Posted By dbt therapy near me | 4/6/21 3:19 AM
SpringCleaning high quality cleaners should clean your residence, apartment or possibly villa for the specifications. We are often the best at that which we do and don't just airborne dust and working surface clean. This Deep Housecleaning Team scrubs, sanitizes and additionally details any residence.
# Posted By cleaning companies | 5/1/21 7:35 AM

© 2021, Stephen J. Withington, Jr.  |  BlogCFC was created by Raymond Camden – Version 5.9.004

Creative Commons License  |  This work is licensed under a Creative Commons Attribution 3.0 Unported License.  |  Hosted by Hostek.com