Closed adamjohnson closed 8 years ago
:+1 would love to see this sooner rather than later.
I accept pull requests. :100:
@zeroedin I'll try to get to it at some point. Trying to get some other stuff done before the weekend.
Ok an implementation note here.
Because of the differences between the CMS and hammer as a tool, you will have to duplicate your editable_region region name in your mock_data.yml file
Example below:
page:
name: "Page Name"
...
content:
region_name_here: "Some Content"
editable_region:
main: "Main content"
...
region_name_here: "Some Content"
The way this works is that it first checks to see if the current page has the content region page:content:region_name_here
and that it contains content, the region_name_here
under page:content
in this case could just be a boolean true
or false
. However if you intend to use that field elsewhere it would behoove you to just duplicate the same content. In this case because of the way radius works with "expanding" tags in hammer the inner tag does not reference the same context.
With that said, without more testing it is possible in more complex looping in pages
context I'm sure there be dragons.
I set region_name_here
in page:
to true
and everything works swimmingly for simple uses of this tag.
As Steve says, if you're pulling content from one page to another, then duplicating the content in the page:
key and the editable_region:
key might be warranted.
Fixed in 4eea618c31b3958d72258751d69cecb1f50cb099
These tags make it easier to only display an editable region & the region's surrounding tags if there is content that has been added to it.
Code Example:
Here's
unless_has_content_for
akaif_doesnt_have_content_for
:Location of tags in CleanSlate source:
lib/slate/radius/tags/page.rb