Macro parameter for a link

Author Message

Samuel Sauder

Friday 06 May 2005 10:13:11 am

In a template, I am trying to replace a string like "%current_user%" in a URL with the actual value. Do I need to create my own operator to do a simple string replace? Or create my own link class?
In attempting to use the "contains" operator it doesn't indicate what position it is at. So I don't know the offset to "remove" it.
Just making sure I'm not missing something obvious :)

Eivind Marienborg

Sunday 08 May 2005 4:03:37 am

http://www.ez.no/community/forum/developer/contrib_str_replace_template_operator

That migt help you :)

Samuel Sauder

Monday 09 May 2005 8:10:36 am

Thank you!
As I was researching more I found this which is very powerful if I want to dive into building my own extension to call **ANY** php function/logic.
http://ez.no/ez_publish/documentation/development/extensions/template_operator

Idea: Why not create a pass-through function that will attempt to execute any php function with a variable number of parameters? Maybe harder than I think... Any comments?

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 20 2025 05:15:31
Script start
Timing: Jan 20 2025 05:15:31
Module start 'layout'
Timing: Jan 20 2025 05:15:31
Module start 'content'
Timing: Jan 20 2025 05:15:31
Module end 'content'
Timing: Jan 20 2025 05:15:31
Script end

Main resources:

Total runtime0.6513 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 589.1563152.6250
Module start 'layout' 0.00540.0035 741.781339.4453
Module start 'content' 0.00890.6407 781.2266501.0391
Module end 'content' 0.64960.0016 1,282.26568.1641
Script end 0.6512  1,290.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.5558160.0002
Check MTime0.00150.2247160.0001
Mysql Total
Database connection0.00070.109010.0007
Mysqli_queries0.600192.1464570.0105
Looping result0.00060.0951550.0000
Template Total0.615894.520.3079
Template load0.00230.352220.0011
Template processing0.613594.193920.3067
Template load and register function0.00020.033210.0002
states
state_id_array0.00100.152810.0010
state_identifier_array0.00150.226520.0007
Override
Cache load0.00180.2723150.0001
Sytem overhead
Fetch class attribute can translate value0.00080.123620.0004
Fetch class attribute name0.00140.218940.0004
XML
Image XML parsing0.00090.134020.0004
class_abstraction
Instantiating content class attribute0.00000.001740.0000
General
dbfile0.00210.3204160.0001
String conversion0.00000.001440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs