SOLVED - add location in template

Author Message

Andreas Adelsberger

Monday 30 March 2009 2:13:39 am

Hi there,

is there a way to add a defined location to a contentobject in a template without going through the browse prozess? Can this be achieved using standard functionality or do I have to write a custom module for this?

Thanx in advance.

---------------------------------------
Styleflasher New Media OG
Websites. Games/Multimedia.

Andreas Adelsberger

Tuesday 31 March 2009 4:27:22 am

I could solve it. Basically I just took the code from the form on the browse page after you hit "Add Location"


<form method="post" action={"content/action"|ezurl} >
				<input type="hidden" name="ContentLanguageCode" value="{ezini( 'RegionalSettings', 'Locale', 'site.ini')}" />
				<input type="hidden" name="HasMainAssignment" value="1" />
				<input type="hidden" name="SelectedNodeIDArray[]" value="123"/>
				<input type="hidden" name="ContentObjectID" value="222" />
				<input type="hidden" name="NodeID" value="251" />
				<input type="hidden" name="ContentNodeID" value="" />
				<input type="hidden" name="AddAssignmentAction" value="1" />
				<input type="hidden" name="BrowseActionName" value="AddNodeAssignment" />
				<input type="hidden" name="BrowseCancelURI" value="/content/view/full/5940/" />

				{def $avail_languages = $content_object.available_languages
					$default_language = $content_object.default_language}
				{if and( $avail_languages|count|ge( 1 ), $avail_languages|contains( $default_language ) )}
				{set $content_object_language_code = $default_language}
				{else}
				{set $content_object_language_code = ''}
				{/if}
				<input type="hidden" name="ContentObjectLanguageCode" value="{$content_object_language_code}" />
				<input type="submit" name="SelectButton" value="addme" />
			</form>

---------------------------------------
Styleflasher New Media OG
Websites. Games/Multimedia.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.