Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo Wiki: How to define variables?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
midnite
Guru
Guru


Joined: 09 Apr 2006
Posts: 449
Location: Hong Kong

PostPosted: Fri Nov 17, 2023 10:43 pm    Post subject: Gentoo Wiki: How to define variables? Reply with quote

https://www.mediawiki.org/wiki/Extension:Variables

It seems {{#vardefine:variablename|specifiedvalue}} and {{#var:variablename}} do not define and retrieving variablename in the Gentoo Wiki User Page.

- - - -

In the source of the handbook below, there are {{#set: architecture=amd64 ... }} as variable definitions.

https://wiki.gentoo.org/index.php?title=Handbook:Parts&action=edit

At the bottom of this source, there is {{#show:Handbook:{{ROOTPAGENAME}}|? architecture}} as the variable retrieval.

https://wiki.gentoo.org/index.php?title=Handbook:Parts/Full/Installation&action=edit

But {{#set ... }} and {{#show ... }} does not work when I am using them in User Page or that Sandbox.
_________________
- midnite.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1944

PostPosted: Sat Nov 18, 2023 3:19 am    Post subject: Reply with quote

midnite wrote:
https://www.mediawiki.org/wiki/Extension:Variables

It seems {{#vardefine:variablename|specifiedvalue}} and {{#var:variablename}} do not define and retrieving variablename in the Gentoo Wiki User Page.

The Gentoo wiki does not have this extra extension installed. I would not suggest adding it with that big warning on the top of the help page either.
midnite wrote:
In the source of the handbook below, there are {{#set: architecture=amd64 ... }} as variable definitions.

https://wiki.gentoo.org/index.php?title=Handbook:Parts&action=edit

At the bottom of this source, there is {{#show:Handbook:{{ROOTPAGENAME}}|? architecture}} as the variable retrieval.

https://wiki.gentoo.org/index.php?title=Handbook:Parts/Full/Installation&action=edit

But {{#set ... }} and {{#show ... }} does not work when I am using them in User Page or that Sandbox.

#set and #show Parser Functions are part of Semantic MediaWiki and need a SMW property created to save its data.
This is only truly worth the effort to reuse those values over other pages, and really, many of them.

The Handbook is a bit special. It uses various inclusion features to not repeat itself over and over.
With a major benefits of ease of most changes and translations only have to be done once for all arches.
Back to top
View user's profile Send private message
midnite
Guru
Guru


Joined: 09 Apr 2006
Posts: 449
Location: Hong Kong

PostPosted: Sat Nov 18, 2023 9:26 am    Post subject: Reply with quote

Hi grknight,

Thank you for reply and explanation.

May I ask as the SMW is set up in the Handbook namespace, it is possible to reuse the #set and #show Parser Functions in the User namespace?

On the other hand, I have studies the ParserFunctions below. They work in the User namespace. But it seems that there is no syntax to set and get a variable. Without variable, their functions are quite limited.
https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions
_________________
- midnite.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54615
Location: 56N 3W

PostPosted: Sat Nov 18, 2023 10:46 am    Post subject: Reply with quote

midnite,

Its worth asking/discussing in #gentoo-wiki on libera IRC too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum