8000 feat(theme): make Istex navigation bar configurable by Temmiiee · Pull Request #2785 · Inist-CNRS/lodex · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(theme): make Istex navigation bar configurable #2785

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

Merged
merged 4 commits into from
Mar 28, 2025
Merged

Conversation

Temmiiee
Copy link
Collaborator
  • Add navigation configuration in theme JSON files
  • Update EJS template to use dynamic navigation items
  • Allow up to 5 configurable menu items

- Add navigation configuration in theme JSON files
- Update EJS template to use dynamic navigation items
- Allow up to 5 configurable menu items
- Add fallback navigation items when no valid links are configured
@Temmiiee Temmiiee requested review from touv and removed request for HeleneCreusot March 27, 2025 15:44
<%
let validLinks = 0;
if (custom.headerMenu) {
Object.keys(custom.headerMenu).slice(0, 4).forEach((key) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L'IA n'y a peut-être pas pensé mais dans ce type de cas, il me semble que l'usage de la fonction filter est plus explicite.

const validLinksArray  = Object.keys(custom.headerMenu).slice(0, 4).filter(item => (item.url && item.name));

Le test suivant se fera sur la taille du tableau et la boucle d'après évitera de refaire deux fois les même traitements:

if (validLinksArray.length > 0) {

validLinksArray.forEach((key, idex) => { 
%>
(...) 
<%= validLinksArray[key].url %>
(...)
<% }); } else { %>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu as raison, c’est une meilleure méthode. J’ai modifié le code pour faire ainsi !

Mattheo Termine and others added 2 commits March 28, 2025 07:19
@touv touv merged commit 7037884 into master Mar 28, 2025
16 of 18 checks passed
@touv touv deleted the themeIstex-headerMenu branch March 28, 2025 10:41
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

Successfully merging this pull request may close these issues.

Thème Istex générique : modifier les accès proposés dans la barre de navigation
3 participants
0