I'm trying to call a UDT from within a module's content using CMS Made Simple v1.11.7. Is there a way to process content so that UDTs are executed? I'd like to process this module's content the same way as page content so user defined tags and global content blocks are available.
The execution of the UDT in a module depends on the implementation of the module. In some cases, it execute the smarty inside the module content, and in some other cases, it does not execute the logic inside the detail. You cannot change this yourself unfortunately.
Some modules do both like MCFactory, where in the module template, you can use {$ModuleName->detail} to show the raw content of the field detail while if you use {$ModuleName->getDetail()}, it execute the smarty logic inside the detail field
Related
In the walkthrough step 7: JSON Model example, the app apparently works as documented but I see the following error in the console:
Error: Modules that use an anonymous define() call must be loaded with a require() call; they must not be executed via script tag or nested into other modules.
The only other instance of this message that I could find seems, to my untrained eye, to deal with a wholly different scenario.
I've tried both Firefox and Chromium, CDN hosting vs local hosting, two different UI5 versions (1.77.0 and 1.79.0), both minified and plain, so I'd suppose this is really something in the code itself.
What could it be? Also, is it something I can safely ignore and why?
Anonymous define
Calling sap.ui.define([...],...) defines a module anonymously because the 1st argument is not a string (module name) but a list of the module's dependencies. If the module name is omitted, the framework automatically determines it based on how the module script was referenced.
Use anonymous sap.ui.define once at top-level of the JS file content, not multiple times.
Replace sap.ui.define with sap.ui.require when simply requiring existing modules.
Cf. my comment at https://github.com/SAP/openui5/issues/2203#issuecomment-420918457.
Named module define
The 1st argument in sap.ui.define("MyModule",[...] ,...) defines the name of the module manually which must be passed when:
Defining a nested module within an existing module definition in a single JS file content.
Defining a module which was initiated by a <script> tag from HTML.
The walkthrough is fixed with SAP/openui5#6302b8f and SAP/openui5-docs#43 accordingly.
I’ve been using assemble (v0.24.3) for a while now and have just noticed that a feature that previously worked now appears not to - namely being able to put data (such as {{title}}) inside of the markdown helper that assemble provides.
Is there a way to do this in the latest version of assemble?
As a use case - I used to use this to prefix site urls with a certain strings when pushing to github pages, as it needed a slightly more specific base url path, but now that data variable just looks like it gets ignored when rendered.
handlebars will create a new "scope" or "depth" when the context inside a block helper is different than the surrounding context. In newer versions of assemble, the context is added from assemble data for use inside block helpers, which causes handlebars to create a new depth. To ensure that you're using the "parent" depth from inside the block helper, you should use the {{../}} syntax:
{{#markdown}}
# {{../title}}
{{/markdown}}
I have used Crisu83-nordcms for CMS purpose
as this CMS provide adding block to page using {{block:blockname}}
and it works
but i want to add block inside block using
{{block:blockname1}}
{{block:blockname2}}
{{block:blockname3}} ......
in CMS block Available tags does nit contain {{block:name}} ...how can i add that.
so that block can contain other block using {{block:name}}
NordCms doesn't allow for using blocks inside blocks to avoid the need to check for possible recursion. We left out that feature in order to keep things simple. Feel free to fork the project and do the necessary modifications yourself if you wish.
Does anybody know how to create his own models and controllers in Orchard-based projects? I have an empty project and a pack of screenshots for pages, but I don't know with what to begin. If it is possible, please show an example.
Thanks.
You should start off at the documentation page. There is an 'Extending Orchard' section which walks you through how to create a module, with data access, content parts, and content fields.
Use the command line to generate the module using the code generation module
Documentation here
Then install the Code Generation Extensions from Piotr and follow the instructions on his blog. http://www.szmyd.com.pl/blog/generating-orchard-content-parts-via-command-line
Module adds an Orchard command-line command “codegen part”. It’s
syntax is as follows:
codegen part [/Properties:]
For example:
codegen part Modules.Shop ProductPart /Properties: Name:string,
Price:int
Properties is an optional parameter, so if you’d like to create an
empty part you can just write
codegen part Modules.Shop ProductPart
The command creates a handler, driver, model, record, display and
editor shapes and updates the Placement.info file with default
Content:before placement for your part shape. If you provide
/Properties parameter, the model, record and editor shapes will be
filled with appropriate code accordingly.
Just installed rails 3.1 rc1 and am trying to grok the best way to manage javascript with the new asset pipeline
By default all coffeescript is compiled into a single application.js file, this is a good thing.
Each seperate coffee script file is appended to the js file and wrapped in an anonymous function which is executed via the call method
A common scenario would be to use some jquery to turn various forms into ajax forms, update UI, etc...
Many of these scripts will be specific to a controller or action, I am trying to grok the 'conventional' way to handle this,
since everything is wrapped in an anonymous function how do I only execute just
the code for a particular controller / action, by default all of the anonymous functions are being executed
I did play around with some hacks where I load the controller and action name into js variables and then in
coffeescript check those to conditionally run code, I don't like that very much
my initial thought was that each coffee file would contain a js namespace/object and I would call the specific ones from the view,
going to spike this using the default_bare = true configuration
see How can I use option "--bare" in Rails 3.1 for CoffeeScript?
EDIT
Looking around some more: this looks like it might be the correct approach - "Can't find variable" error with Rails 3.1 and Coffeescript
There are two common approaches:
Make behavior conditional on the presence of a particular element. For instance, code to run a signup sheet should be prefaced with something like
if $('#signup').length > 0
Make behavior conditional on a class on the body element. You can set the body class using ERB. This is often desirable for stylesheets as well. The code would be something like
if $('body').hasClass 'user'
gistyle is a simple gem that helps you running action-specific javascript codes.
By following its setup, you set some data attributes in your body element, representing the current controller and action names. Then it will only call that action when the corresponding view is loaded.