Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Titles - make dynamic for people etc. #236

Closed
mworrell opened this Issue Oct 20, 2011 · 5 comments

Comments

Projects
None yet
3 participants
Owner

mworrell commented Oct 20, 2011

Currently the 'title' is just an attribute in the property list of a rsc.

Some resource categories don't really have a title though. Think of people and files.

I suggest to make the title optional, and add a notification to fetch the title or overrule an existing title. In the case of a person this could then render a template that concatenates the first name and other names into a title to be shown.

Maybe use a catinclude for _p_title.tpl (which would give _p_title.person.tpl etc)

This makes it easier to re-use templates.

@ghost ghost assigned mworrell Oct 20, 2011

Owner

kaos commented Oct 25, 2011

+1, I like it.

I've actually solved exactly this (but for a slightly different use case) by observing the rsc_update_done notification, and updating the title (and body text) by rendering some custom templates.

So, in my case, not only the title, but also other properties would be interesting to be able to easily "override" in this way.
Perhaps by passing some prop when saving the rsc, as to which fields should be filled by a rendered template.

Owner

mworrell commented May 2, 2012

There is now a new notification #rsc_get{} which get folded when a resource is read.
This notification can be used to add computed values.

Note that you can't use a template during this callback as that will result in a loop for the get of a property.

Owner

arjan commented Sep 12, 2012

Looks good enough for me..?
Maybe its overkill to use a template for such a value?

Owner

mworrell commented Sep 12, 2012

we can also only do it iff the title is not set.

so: title =:= undefined -> do catinclude of template for title.

Owner

arjan commented Sep 12, 2012

Don't know how this will work in the admin... should the title input box be disabled?
How does the admin know that the title will be auto-generated?

Let's postpone this to a next feature release...

@mworrell mworrell closed this Apr 22, 2015

@mworrell mworrell modified the milestones: Release 1.0, Enhancements for later Apr 22, 2015

@mworrell mworrell removed the enhancement label Apr 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment