This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of DevSecOps Adventures: A Game-Changing Approach with Chocolate, LEGO, and Coaching Games and have Dana Pylayeva on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Change or create an entry in a theme template file

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I see in the bottom.htm there is ${usersOnline} where you get the status of the user.
I?m personalizing the template and I need only the number of connected users the ${usersOnline} returns me a sentence.
Where can I change the code to add and entry to do this like ${numberUsersOnline}? Is there documentation or something I can read to understand this model?

TIA
Marco
[originally posted on jforum.net by radar]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Edit the file net/jforum/view/forum/ForumAction.java, method "list". There you will find all code for the forum's home page.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
thanks for the quick answer, I saw there are many useful entries that I can use like "totalOnlineUsers" that could be what I need.


[originally posted on jforum.net by radar]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I see the ${totalOnlineUsers} is valid only for the home page but if I go to login page, for instance, this entry doesn't exist. Is there a way that I make it global?

I see ${forumTitle?default("JForum")} entry in the header.htm, for instance

TIA
Marco

[originally posted on jforum.net by radar]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Was this resolved? I am trying to do the same but getting the same error... any help would be appreciated. thanks.

[originally posted on jforum.net by hsb]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For performance reasons, the "global" template variables are pretty much static lookups from the cached config file. However, if you need some custom globals, it's not too hard to modify the prepareTemplateContext method in the ControllerUtils class to add what you need.
[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. So can i just not add static variable to config file? if not can you help me with modifying prepareTemplateContext method? I am not really Java person.
[originally posted on jforum.net by hsb]
 
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic