[greenstone-users] Re: [greenstone-devel] [Help] pls help

From Greenstone Team
DateTue Apr 5 16:52:26 2011
Subject [greenstone-users] Re: [greenstone-devel] [Help] pls help
In-Reply-To (forum-38148-9751944-sourceforge-net)
Copying response posted at SourceForge to mailing list.

Hi Prabhat,

I am not aware of a macro to do that, but you could try using
javascript. The Location object in javascript gives you access to the
hostname or IP parts of a URL you're on. See
w3schools.com/jsref/obj_location.asp

Now, go to the "macros" folder of your Greenstone installation find the
macro file (extension .dm) from where you want the hostname displayed.
Into this macro file, add in the Javascript code that will refer to the
Location object's hostname for displaying it. See the Greenstone
tutorial at
wiki.greenstone.org/wiki/gsdoc/tutorial/en/using_macro_files.htm to
learn a little about Greenstone's macro files and how to insert lines to
get them to display on each page and how to determine which macro file
to edit.

Finally, note that if you want to use javascript code in macro (.dm)
files, you may need to escape some characters like curly braces. To see
how this is done, inspect a file like macros/query.dm where javascript
functions are declared and used. You will want to write any javascript
functions in the same way into the macro file you choose.


SourceForge.net wrote:
> The following forum message was posted by prabhat08 at http://sourceforge.net/projects/greenstone/forums/forum/38148/topic/4433509:
>
> hi friend
>
> can anybody tell me that which macro i have to use for print my hostname in
> greestone.
>
> i.e. localhost or ip
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> greenstone-devel mailing list
> greenstone-devel@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel
>