Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug or feature: variables/macros #1760

Open
pit47623 opened this issue Apr 4, 2024 · 5 comments
Open

Bug or feature: variables/macros #1760

pit47623 opened this issue Apr 4, 2024 · 5 comments

Comments

@pit47623
Copy link

pit47623 commented Apr 4, 2024

"GeneWeb text present in notes are not pure HTML and may contain variables."
(https://web.archive.org/web/20230926000036/https://geneweb.tuxfamily.org/wiki/macros - https://geneweb.tuxfamily.org down?)

The documentation lists a wide range of variables to be used in "notes" (%t, %f, ...), but most of them seem not to work.

Working:
%s - used in (e.g.): href="%sm=IM;s=my_pic.jpg"
Also working:
%i - resolved to "peter.1.essen" (used in my personnal entry)

not working (cgi-mode!):
href="../%t/video/happy_birthday_pit.mp4
Due to documentation I expected resolving %t to my database name, i.e.: href="../essen/video/happy_birthday_pit.mp4

My workaround:
1.) var_base=essen in essen.gwf
2.) href="../%vbase;/video/happy_birthday_pit.mp4" - works! :)

But what about all that pretty variables listed in the documentation?

Tested in cgi-mode on:
6.08 on win10 (patched, cf. #103)
6.08 on ubuntu-mint
7.01 on raspberrypi
Resolving also tested on 6.08 server-mode on raspberrypi -

Best regards
Pit

@michelmno
Copy link
Contributor

I have same problem if macros used in notes of an individual.
A potential direction to continue investigation: those macros do work if present in a macros.txt accessed as m=SRC as per wiki page https://web.archive.org/web/20230926000036/https://geneweb.tuxfamily.org/wiki/macros#List_of_macros (I tested that successfully with last geneweb/master branch cid b779ee5)

@hgouraud
Copy link
Collaborator

hgouraud commented Apr 4, 2024

I am not at my desk, but I think I remember that all macros are available with m=SRC, but only partially within notes. I will check.

@hgouraud
Copy link
Collaborator

hgouraud commented Apr 4, 2024

I also think I put in the wiki doc a file that will demonstrate all macros if called with m= SRC. See the macros page on tuxfamily.

@hgouraud
Copy link
Collaborator

hgouraud commented Apr 4, 2024

Reading the code, I see that the string_with_macros function handles only s and v macros. I would have to dig deeper to see where the %i trick comes from!!
It might be worth trying to use SrcfileDisolay.macro instead (might require some recoding)!!

@rpo
Copy link

rpo commented Apr 4, 2024

I have never fully understood how and when most of those macros works and in which context to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants