PDA

View Full Version : Call html from \"FREE TEXTUAL INFO\"


dunhill
5th of December 2003 (Fri), 19:43
Can anybody please tell me if it is possible to call a html page from the "FREE TEXTUAL INFO" under the Exhibition Editor.

Its says "can contain html if link activiation is off"

If it is possible to call a htm page , if you could provide an example of how to do it I would appreciate it.

Basically I want to store the Exhibition description within a web page which will also conatin images.

Thank You

Pekka
5th of December 2003 (Fri), 20:37
With PHP you can't use SSI which is the "conventional" way in html to include files. Only PHP is allowed.

Open gallery/pagetemplates/photo/default.php

There you have a variable "$description_text_html" which contains the description text. Including files with PHP is easy: this code for example includes header above and below the text, if the text exists (silly but this is a demo):

if ($description_text_html != "") {
print "";
include("header.php");
print $description_text_html;
include("header.php");
print "";
}

A better way is to use the "$description_text_html" variable in the php file you include.

if ($description_text_html != "") {
include("framed_description.php");
}

Now, the the "framed_description.php" would contain straight html code where you print the description with PHP code



and that can be placed anywhere you like in you html. The file is .php but that does not bother html.

dunhill
6th of December 2003 (Sat), 02:10
Thanks for your reply.

Ill try and explain exactly what I am after maybe you can think of a better way of doing it with EE.

My exhibitions are location/city based within 1 country.

Lets say my country is Germany, so all my photos are of Germany, my exhibitions are per city in germany.


What I have is a Gif map of Germany in a html page, i use html to place a red dot approximatly where the location/city is using the following code:

"

Pekka
6th of December 2003 (Sat), 07:17
OK, now I see. This is easiest done with case structure. Each exhibition has its own result (include something) and if no cases are found then default case is to print the normal description. The @ sign suppresses error messages if file is not found for some reason. Variable $exhibition holds current exhibition id which we compare to. So, you'll need to change or add to this code when deleting or adding exhibitions.

(click "reply with quote" and you'll see the code with tabs, much easier to read)

In pagetemplates/list/default.php

Replace lines




with

dunhill
7th of December 2003 (Sun), 05:19
Pekka,
Thank you very much for your help, I have created a php script whch calls my html which does the gif overlays. This works.

I added your case statement, the only problem i am having now is that my php doesn't seem to be called, i think it might be because of the location of MY php directory

My directory is called "map" and its one directory below the GALLERY directory.

I don't know from which directory its being called i am assuming from the "GALLERY/pagetemplates/list" directory.

I tried using the following but its not working
case 1:
@include("../../../map/map_test1.php");

I even tried going back 2 and 4 directories.

So I gather i must be doing something wrong.

Thank You very much

Pekka
7th of December 2003 (Sun), 07:46
Set the relative include path counted from gallery root (list.php). This is so because list.php includes default.php, and at that point anything that default.php includes are actually seeked from list.php's folder level.

If your list.php is in

/www/gallery/

and maps in

/www/gallery/map

the include must be

@include("map/map_test1.php");

dunhill
8th of December 2003 (Mon), 05:48
Pekka,
Thank you for your help, but I must be doing something wrong as its still not displaying.

I have copied the map directory to the GALLERY directory.

www.xxxx.com/GALLERY/map

www.xxxx.com/GALLERY/pagetemplates/list/default.php

has the following call: "@include("map/map_test1.php");"

now I think this might be the problem but I really don't know. "map_test1.php" has "include('map.html');"

"map.html" is in the map directory and all the gif files are in the map directory. "map.html" calls the gif files without any directory details, it should pick it up from the current directory?

Everything should be ok as far as I can see, its just not working, your assistance is appreciated.

Thank You

Pekka
8th of December 2003 (Mon), 17:02
The map.html is AFTER INCLUDE located virtually in gallery root, so you should make its internal links fetch data from that location.

The principle goes:

you have

/stuff/my/good/pages/1.html

which gets its images from

/stuff/my/good/pages/images/

e.g. img src="images/germany.gif"

Now you include 1.html into file

/stuff/my/site/test.php

Image links in 1.html should be

img src="../good/pages/images/germany.gif"

You can get around that by using direct http adresses in image links, or with php files juggling e.g. your $rootpath variable depending where you are.

Also, why not copy contents of map.html to map_test1.php. Or just include map.html directly if you do not need php tags there. There is no need to add more nesting which is usually problematic.

dunhill
8th of December 2003 (Mon), 19:38
Pekka,
I didn't think based on your first response that I could call "map.html" directly from "pagetemplates/list/default.php"

Thats all I really wanted, i didn't want to do any php :-)

So it won't be
-----------------