Themeing Node/Add form - Taxonomy Field - drupal-6

I am theming a custom tpl.php file to style my forms.
I am printing my fields with something like this:
print drupal_render($form['field_sr_minutes'])
The problem is that on one element I need to get in this form is a taxonomy field, which is what i'm having a problem with. It will display with drupal_render($form), but I want to put it in a specific place, similarly to how I'm doing it with the normal node fields.
However, what I'm trying won't work:
Shows in HTML source as name="taxonomy[6]"
So, I'm trying things like
print drupal_render($form['taxonomy[6]'])
print drupal_render($form['taxonomy_6'])
print drupal_render($form['name_of_taxonomy'])
But, no go...
Any Ideas???

Taxonomy fields are all present under the name taxonomy in the node form. So you can just print that.

Related

Adding custom text to each Collection listed on homepage

IN BIGCARTEL: Is there a way to add CUSTOM TEXT to each individual collection that is displayed on the home page? I want this text to only appear when the collections are listed on the home page and not anywhere else.
Adding the additional text to the collection name in the product section does not solve this.
Adding a custom HTML on the homepage appends the same custom text to all collections. Again not right.
Any advice on creating a text that appears only with a particular collection, and only on the homepage?
If you are using JavaScript, try this:
if(~window.location.pathname.indexOf('index'){
// your code
}
The code above will run it only on index.html, which is your homepage.

Building a list of downloadable items in Orchard 1.6

I'm fairly new to Orchard and I'm wondering about the "best" way of building a basic list of documents with a download link?
Say the scenario is this, I want to make a list of newsletters, the news letter are in PDF format and the users should be able to download then straight from the list view.
An admin, should easily be able to add a new newsletter and it should turn up in the list.
My current train of thought is to, all through the dashboard,
create a content type "Newsletter" with a title field and a Media picker field, using the media picker field to upload the PDF file.
Then create a query, with the filter on Content type "Newsletter"
Create a projection pointing to the query
However, this only gives me a list of content items, showing their title as links back to the actual content item.
I've tried adding a layout to the query and set it to display properties instead of content. By doing that I can get a list where I can control the "output" a bit more. And I've gotten it to list the title and by doing a Rewrite and putting in the MediaPicker.Url, it also displays the URL in the list. This is all good but here I get stuck..
As the MediaPicker.URL outputs the url in the format like ~/media/default/xyz/filename.pdf, I cant just put it into a a href, it doesn't give a correct download link to the file.
Soo, question is, am I thinking and doing this totally the wrong way or am I missing something obvious? All ideas and suggestions and more then welcome.
Use or adapt the following template override in your theme:
#{
var url = Model.ContentField.Url;
}
#if(Model.ContentField.Url != null) {
if (url.StartsWith("~/")) {
url = Href(url);
}
<div class="media-picker-field attachment-pdf">
<span>download</span>
</div>
}
Modify the text as needed. This template was a Fields.MediaPicker-PDF.cshtml that was used for a media picker field named PDF.

Orchard CMS adding an additional HTML part to page content type?

I'm trying to break my body into pre content, content, and post content so I can inject ads and what not within my articles. The only HTML field module is broken for 1.4 at the moment and I can't seem to add additional body parts to the page. I'm having to create my pre content in the body, then cut the HTML into a pre conntent text field. And do the same thing for post content. There's got to be a better way to do this. Is there any way to have more than one HTML editor field in the page editor?
As I told you in another answer, you can configure the Text field to use HTML. Just add the text field, and then expand it in the type editor. There is a drop-down where you can choose HTML.

Expression Engine 2 Next/Previous Entry Linking with Full Entries List

I want to use the Next/Previous Entry Linking technique in EE2:
{exp:channel:next_entry}
<p>Next entry: {title}</p>
{/exp:channel:next_entry}
{exp:channel:prev_entry}
<p>Previous entry: {title}</p>
{/exp:channel:prev_entry}
When this works, I'm on a single entry ie. awesome.com/index.php/my-cool-entry, I can click page through the entries in that channel.
Is it possible to ALSO display a full list of the entries on this page while I'm looking at one article? I want to be able to show the list of entries as a way to navigate to a particular article.
Think of it like the way {pagination_links} builds links:
First Page < 1 2 3 > Last Page except instead of numbers I want to display parts of that entry, rather than just a number.
What bothers me is that {paginate} generates ugly URLs ie. awesome.com/index.php/articles/P1, I'd rather have awesome.com/index.php/articles/my-cool-entry. exp:channel:next_entry/prev_entry preserves the URL_title!
Is there a plug-in that can handle this kind of thing?
Embedding a template is the way to go.
Create a new template with an {exp:channel:entries} loop. Within that you can dump out the entries you want and display any info you want from them.
One thing to make sure of is to use the dynamic="no" parameter within the {exp:channel:entries}. It'll go something like this:
In your article page, embed another template:
{embed="article/full_list"}
And within the article/full_list template use a loop like:
{exp:channel:entries dynamic="no" channel="[YOUR CHANNEL]" LIMIT="10"}
{title}
{/exp:channel:entries}

How to Get and Output Field Choices in a Custom SharePoint List DispForm Page?

I'm working on a custom Display Form for a SharePoint list. Is there a way to get the field choices for a field that has multiple choices? That is, I can print out the chosen value with something like:
<xsl:value-of select="#Migration_x0020_Status" />
But, I want to print out all the choices, including the one that was chosen. The closest I've come is to use the FormField element from the EditForm page like the following:
<SharePoint:FormField runat="server" id="ff4{$Pos}" ControlMode="Edit" FieldName="Migration_x0020_Status" />
However, that prints out SELECT and OPTION elements. I want to get the underlying choices and print out my own stuff (eg: with UL and LI elements). How can I do this?
i would suggest to use object model to create a custom webpart for the same. if thats not the CHOICE I would like to suggest a slight change in your architecture to include lookup column and then in your xslt datasource add the master list data source as well and then work on xslt to show it the way you want

Resources