drupal 6 cck format in custom template file - drupal-6

i'm creating a custom .tpl file for a node type with some cck fields.
In de cck module i selected a integer format style for a field.
Now in the tpl i load the field from the $node object but it's without format (9999 in stead of 9.999).
In the $node object you have an item '#theme' and '#formatter', i guess i need one of these but how?
i tried the theme() function but then it doesn't display anything.

i've used content_view($node); to 'render' all the values.
Putting this on the top of the page gave me an array with all the right (themed) values.

Related

Added a Custom field to media elements, where do I assign values in administration view

Added a Custom field to media elements, where do I assign values in administration view?
Can't find the field to set the value for the image object.
Expected to set it for an image object globally
Problem fixed with Version 6.4.17.0
https://issues.shopware.com/issues/NEXT-22512?products=SW-6&edition=community,professionalEdition,enterpriseEdition,shopwareRise,shopwareEvolve,shopwareBeyond&projects=all&type=1,4&status=open,inProgress,done&search=NEXT-22512
Find the file after navigating to Content > Media. Select the file and in the sidebar to the right you should find the the custom fields sets at the very bottom.
Update: As of today there is an issue with custom fields in the media module, that was already fixed but not yet released.

Display strapi fields instead of id

I am developing one project using strapi.
I have created one dynamic component with the following structure.
I have added this component in one of my collections called "Markup" which is single-type collection.
When I add some data in markup collection like this:
Here, instead of id of component I want to display range.
for example,
In the above screenshot, strapi is displaying "1" in component header. I want to replace it with something like this: ${min}-${max}.
so, instead of "1" it should display "5-9.9" and instead of "2" it should display "10-24.99"
How can I change this?
Created one new field called displayName in the component and set it to ${min}-${max} when a user updates an entry in the component record and then sets the field displayName to display field from strapi view configuration.

Access content field from views in Orchard CMS 1.10.1

I would like to display certain first level menuitem in bold.
This setting should be done by a checkbox when the user create / edit a menu item. (I have a workaround using the Model.Href, but it is not nice).
So I created a boolean field in Content definition / Menuitem URL (I don't know the name of the corresponding content definition in English Orchard).
How to access a custom field (Content Field) from a view?
(There already is a view which is used to customize the menu)
The examples I found use custom shapes, where the fields are accessed as built in fields (e.g. Model.ContentItem.FieldName ). But this is a different case.
With the help of "Piedone", the solution:
Model.Content.ContentItem.MenuItem.FieldTechnicalName.Value
Explanation
Examining the Model object in Visual Studio, the Model is a dynamic shape that have eg. Href property and a Content.
Content is a MenuPart, that is a content part that have a ContentItem property with the content item itself. Technically only content parts have Fields. When you (seemingly) add a field to a type it will be a part corresponding the type's name, that is MenuItem in this case (It's confusing that the display name of 'MenuItem' content type is Custom Link...)
The field's technical name is as you name it. When you add to a type, the Value will be a property of the BooleanField class. (By the way, it is nullable, so if you dont't save after adding the field, it will be null else the value you set).

How to build a webform with custom fields in drupal 7?

I want to build a custom webform using webform module in drupal 7 but I want to use custom fields as form fields. Is there a way to do it?
To create your custom field as per requirement follow this awesome link.
http://jamestombs.co.uk/2012-09-24/create-new-webform-element-drupal-7
Cheers!!!
You just have to create a new piece of Webform content by going to Content > Add Content > Webform. Once you make your title, body, etc, click "Save" and you'll be taken to the next step of creating your form fields (called "Components"). In the components area, you can add whatever type of field you'd like, and all the submitted data will be stored in the "Results" area for that piece of content.

Person & Group custom field type sharepoint

I have created a custom field type as it is there in sharepoint OOTB, the difference is only that the end user does not need to check the name i.e I have replaced it with DropDownList. The dropdownlist suggest the no. of users available in the web site for that I have created a FieldClass which inherits from SPFieldUser and a FieldControlClass which inherits from UserField. It is working fine in all conditions i.e when I create a List or Document Libarary it shows me the DropDownList
with respective users after saying OK it creates an item for me. I have overriden a Value property in FieldControlClass as follows,
public override object Value
{
get
{
SPUserCollection userscollection = rootWeb.SiteUsers;
//ddlInfoBox is a DropDownList to which I have Binded the collection of users in the form of string
SPUser user = userscollection.Web.EnsureUser(this.ddlInfoBox.SelectedValue);
SPFieldUserValue userval = new SPFieldUserValue(user.ParentWeb, user.ID, user.LoginName);
return userval;
}
set
{
SPFieldUserValue userval = (SPFieldUserValue) this.ItemFieldValue;
this.ddlInfoBox.SelectedValue = userval.Lookupvalue; //Here look up value is nothing but a Login name e.g In-Wai-Svr2\tjagtap
}
}
Due to above property the Custom Field's Value for this current ListItem will be stored as SPFieldUserValue e.g 27#;In-Wai-Svr2\tjagtap.
The main problem is here, when this particular ListItem is shown in the list page views e.g on AllItems.aspx or the custom view pages associated with it, it shows the
number as 27 as a FieldValue insted of HyperLink with text as "In-Wai-Svr2\tjagtap" and PostBackURL as "/_layouts/userdisp.aspx?ID=27".
When I edit this Item it makes the respective value selected in the dropdownlist, also while viewing this item i.e on DispForm.aspx it also shows the hyperlink. I have
acheived it by writting a custom logic in createchildcontrol() method i.e by using ControlMode if it is New or Edit then fill the dropdown list, if it is Display then get the ItemFieldValue Type Cast it into SPFieldUserValue and get corresponding lookupid and value for making the URL and showing Text of the HyperLink.
I have spent a lot of time on searching and bringing the HyperLink as the user name with navigation insted of UserID (27) as a string on the list view pages e.g AllItem.aspx but to no avail, then after a lot of research I found that there might be a way of achieving such kind of functionality by using field type definition xml file where there is a provision to define a DisplayPatteren as you wish by specifying the html code. But here is a problem How can I get the UserID (27) with respective UserName e.g In-Wai-Svr2\tjagtap inorder to make an anchor tag like In-Wai-Svr2\tjagtap which will solve my problem. I have hard coded this anchor tag within the Default case statement of a switch under DisplayPatteren but it shows me the field value on AllItems.aspx as
In-Wai-Svr2\tjagtap27 i.e the value defined in xml file is concatenating with the string value (27).
Please help me to resolve the above mentioned 2 issue. I am really in need of solving this problem ASAP.
Thanks & Regards,
Tejas Jagtap
Have u tried to override the GetFieldValueAsHtml() method in the the custom field class or maybe the RenderFieldForDisplay() method in the custom field control class.
Can you use the DisplayPattern CAML from the User field type?

Resources