I'm trying to include the value of the user field "Job Title" in a Liferay-Theme (6.1.20), but I can't find the proper VM-variable.
If there isn't one, how would I go about displaying that information or (alternatively) a custom field for users.
I figured it out. There's no special VM-variable, but you can use the $user variable like so:
$user.getJobTitle()
Related
I am trying to use the Contentful web interface to change the name of an entry. Attached is a screenshot. I have searched for 30 minutes for the button that lets me change the title from "untitled" to something else. Alas, it is nowhere to be found on this horrible, horrible interface.
Where is it? Does it even exist?
In Contentful, the entry titles must be handled by a content model field.
In your content model, create a field
Then, tell Contentful to use this field as entry title
Now, you can create a new entry and set the title
I have built a website (with MODX) where some products are managed and displayed via the articles addon. The products should have a custom ordering but I don't know how to use a template variable for that.
If I enter the name of the TV in the "Sort Field" field nothing is shown at all.
So is it somehow possible to use a TV there?
Or is there another way to achive a custom ordering (note that I need the summary and date fields, so I cant't abuse them for that)?
You can do this by using getResource package. Look at sorbyTV, sortdirTV, sortbyTVType parameters in manual:
http://rtfm.modx.com/extras/revo/getresources#getResources-SelectionProperties
Basically what I want to do is create a form whilst within another form and pass values from the earlier form to the second. Complicated I know but here is what I got.
#Do(#Command([Compose];"LPK"); #SetField("PR_Make"; PR_Make))
The fields in both forms have the same name and this code is called when first document is attempted to be saved.
I think instead of editing the field on the second form it just saves a field as itself instead. Any help appreciated.
The best and common way is to enable form property "Formulas inherit values from selected document" in second form "LPK".
Add a default value formula to second form's fields you want to inherit and put just the name of field itself in. For your example default value formula it would be
PR_Make
Make sure you save document first and then create the new document.
Knut Hermann's answwer is the 'standard' way of achieving such things but there are other methods- eg you can use environment variables ..
Something like:
#Environment("PR_Make") := PR_Make;
#Command([Compose];"LPK");
Then set the default value for PR_Make in your new form as ..
#Environment("PR_Make")
FYI Environment variables are written to the user's Notes.ini file and so remain even after Notes has been closed and re-opened. #Environemt doens't work too well with Web applications as it uses the server's notes.ini.
An alternative would be to use profile documents:
#SetProfileField( "PRDefaults"; "PR_Make" ; PR_Make;#Username);
#Command([Compose];"LPK");
.. in the default field for PR_Make on new form :
#GetProfileField( "PRDefaults"; "PR_Make"; #Username);
Profile documents are stored as a kind of hidden document in the Notes database and persist with the database. The last parameter sets a further subdivision by username so each user gets their own profile doc - a bit like a personal profile for "PRDefaults". You can miss this last parameter #Username out, to have one profile doc per database but there's a risk of two people trying to use it at the same time and clashing.
Profile docs also work with web applications.
I created a custom content type called ContentPage and attached a taxonmy field (Taxo). I'm trying to have the autoroute generate the route off the Taxonomy term selected for ContentPage. The end result should be http://my-site.com/taxonomy/term/slug
Here is one of the rules I tried: {Content.Fields.ContentPage.Taxo}/{Content.Slug}
Whatever I try, I only get the slug.
This has been asked in many occassions. you need to look at the way the slug is created and get a token too.
Check This out, will help : taxonomy-term-autoroute
I would like to show / hide certain fields in my Drupal view accordingly to the user role.
Provided I can only have this view to work with, how can I achieve this programmatically or there's some settings that I am not aware of in Drupal.
P/S: I am aware of the access settings under basic settings in View but that would restrict access to the whole view, not field level.
You can create two identical Displays (within the same view) and override the field settings and access settings in each of them. For example, in the first display show the fields you only want a certain role to see, and set the access control setting to that role. In the second display, remove the unwanted fields and set the access control to the corresponding role.
Start by creating the most restrictive display first and then the least restrictive one.
I liked this answer, but in my case the field is dependent on the argument and I would need to create a new display for each argument (which isn't practical).
I installed the Views Custom Field module and used this code for the field:
<?php
if(user_access("some permission string here"))
{
print "Your field value here";
}
?>
Click advanced, theeming, find the field and make a _.tpl.php file for it, then in the file you will see:
print $output;
Change this to:
if (user_access('administer nodes')) {
print $output;
}
Or whatever the permission is you are checking against.
I think you have to try module Field Permissions
If your the fields you want to exclude are 1) created with CCK and 2) should be hidden from users of that role everywhere on the site (not just in this particular view) then you can just set the permissions on the fields so that users are particular roles can't view them. If the current user doesn't have permissions to view a field that is part of a View, the field won't be shown to the user.