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.

eZ debug

Timing: Jan 31 2025 01:32:06
Script start
Timing: Jan 31 2025 01:32:06
Module start 'layout'
Timing: Jan 31 2025 01:32:06
Module start 'content'
Timing: Jan 31 2025 01:32:06
Module end 'content'
Timing: Jan 31 2025 01:32:06
Script end

Main resources:

Total runtime0.0264 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.1250151.2109
Module start 'layout' 0.00560.0045 739.3359220.6875
Module start 'content' 0.01010.0145 960.0234997.8047
Module end 'content' 0.02460.0018 1,957.828133.9922
Script end 0.0264  1,991.8203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003111.6281140.0002
Check MTime0.00134.9359140.0001
Mysql Total
Database connection0.00083.020710.0008
Mysqli_queries0.002710.110030.0009
Looping result0.00000.053210.0000
Template Total0.00145.310.0014
Template load0.00114.092010.0011
Template processing0.00031.207610.0003
Override
Cache load0.00082.998210.0008
General
dbfile0.00031.130980.0000
String conversion0.00000.030740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs