How to include external html

Author Message

Andreas Zwinkau

Saturday 13 August 2005 6:26:49 am

I want to include a html snippet from an external url into one page (article). Probably similar things will come up later, so i think a CustomTag insert is the best way to do this.

The template language does not support fetching from url, does it? How should this be done?

The external url is: http://www.evangelische-termine.de/Veranstalter/teaser.php?vid=1099&count=10&t_high=all&t_kat=all

Gabriel R.

Saturday 13 August 2005 7:42:34 am

Use the php function 'file_get_contents' defined as a new ezp template operator to fetch external content.
See http://ez.no/products/ez_publish_cms/documentation/development/kernel/custom_template_operators
for detailed information

Override the template.ini file:

[PHP]
PHPOperatorList[file_get_contents]=file_get_contents

Example:

{'http://www.evangelische-termine.de/Veranstalter/teaser.php?vid=1099&count=10&t_high=all&t_kat=all'|file_get_contents}

Greets,
Gab

Andreas Zwinkau

Saturday 13 August 2005 9:40:14 am

Thanks! It works very nice.

Just to ask, if i did it the right way:
I created
settings/override/template.ini.append for the PHP function
settings/override/content.ini.append for the custom tags
design/corporate/templates/content/datatype/view/ezxmltags/insert.tpl for the template for the custom tag insert

Gabriel R.

Saturday 13 August 2005 10:02:26 am

Seems to be ok

risto CMS user

Friday 25 November 2005 5:19:38 am

would you mind showing the actual code you added? I cant seem to get this right!

Alexandre Cunha

Friday 24 March 2006 8:35:27 am

settings/override/content.ini.append  -  for the custom tags
design/corporate/templates/content/datatype/view/ezxmltags/insert.tpl  - for the template for the custom tag insert

Can someone help me ?
I need examples for the content.ini.append and insert.tpl
No understand why need change this files to allow include external html

http://AlexandreCunha.com

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

Main resources:

Total runtime0.0176 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 588.1406151.2109
Module start 'layout' 0.00650.0025 739.351636.6484
Module start 'content' 0.00900.0068 776.000094.2656
Module end 'content' 0.01580.0017 870.265633.9922
Script end 0.0175  904.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002514.4654140.0002
Check MTime0.00116.2274140.0001
Mysql Total
Database connection0.00148.029110.0014
Mysqli_queries0.002413.731430.0008
Looping result0.00000.090910.0000
Template Total0.00147.810.0014
Template load0.00105.969610.0010
Template processing0.00031.793610.0003
Override
Cache load0.00063.562810.0006
General
dbfile0.002011.472580.0003
String conversion0.00000.050240.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