erdmannfreunde / contao-onepage-navigation Goto Github PK
View Code? Open in Web Editor NEWExtension for Contao CMS to create onepage navigations
License: GNU Lesser General Public License v3.0
Extension for Contao CMS to create onepage navigations
License: GNU Lesser General Public License v3.0
The Option Reference Page, where you can select a page, which articles should be used for the navigation is not working anymore.
Hallo,
ich habe die Extension letzte Woche installiert (1.1.16) und sie funktioniert grundsätzlich erst mal (Contao 4.9.14).
Nur setzt sie die Klasse "active" nicht, wenn man die Menüpunkte anklickt.
Zu sehen unter: https://www.asi-online.de/beratungsangebot.html
Danke für einen Tipp!
Tanja
Bei Verwendung von js_onepage_navigation funktioniert die Erweiterung korrekt. Bei Verwendung der jQuery-Version j_onepage_navigation wird die active Klasse nicht vergeben. Ist das template j_onepage_navigation veraltet?
[2023-11-29T09:37:33.393960+00:00] request.CRITICAL: Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\ClassNotFoundError: "Attempted to load class "BackendTemplate" from the global namespace. Did you forget a "use" statement?" at /var/customers/webs/xxxx/vendor/erdmannfreunde/onepage-navigation/src/Modules/ModuleOnepageNavigation.php line 42 {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\ClassNotFoundError(code: 0): Attempted to load class \"BackendTemplate\" from the global namespace.\nDid you forget a \"use\" statement? at /var/customers/webs/xxx/vendor/erdmannfreunde/onepage-navigation/src/Modules/ModuleOnepageNavigation.php:42)"} []
Since PHP 8.0.0 undefined properties result in a warning.
Do you wish a small PR?
It looks like articles are sorted by id and not their order in the article structure.
To reproduce:
On one of our pages, the second article on the page is set as the first article within the navigation.
When I open the page this first menu item is always marked with class="active" even when it is definitely not in the viewport (first article has height: 100vh;).
Is this a bug or a feature that I don't understand?
Looks weird when you open the page and it marks the wrong sections as active.
Hallo,
leider geht die Navigation nach dem Update auf die 4.9.17/18 nicht mehr.
Bis zu 4.9.16 war noch alles OK.
Ich habe den Fehler auf 3 Seiten.
z.B.
Viele Grüße und Danke
Alex
Hallo,
auf einer Website funktioniert bei Verwendung er onepagenavigation das normale Scrolling auf Touch-Geräten nicht mehr. Beim Scrollen wird immer auch der nächste Onepage-Artikel angesprungen. Das ist insbesondere doof, weil die Artikel-Inhalte länger sind, als der Viewport, so dass man immer nur den ersten teil des Inhalts lesen kann.
Ist das ein Bestandteil des Javascrips und kann ich das irgendwo deaktivieren, so dass die Website ganz normal scrollt?
Vielen Dank und viele Grüße
Timo
If the onepage-navigation-module is placed in a layout that is used by the 404-Pagetype the error-page does not work anymore.
This can be mitigated if you select a rootpage for the module.
Is it possible to provide an option in the Backend to work with a fixed header?
Therefore you need to provide an input for the height of the header, menu or whatever the fixed header is made of.
It should be possible to provide a number or a CSS class:
The header could be 200px or 10vh or something like this in height or the height of the container with a specific CSS class or ID.
Original Code (j_onepage_navigation.html5):
if (target.length) { event.preventDefault(); $('html, body').stop().animate({ scrollTop: target.offset().top
Code for fixed header with dynamic hight detection:
if (target.length) { event.preventDefault(); $('html, body').stop().animate({ scrollTop: target.offset().top - $('.cssclassname').outerHeight()
Code for fixed header with a specific number (200px) of height:
if (target.length) { event.preventDefault(); $('html, body').stop().animate({ scrollTop: target.offset().top -200
if i write in the article class home, the new css is homeonepage_article.
it is missing a distance between the custom style and the onepage class
When I scroll to the top of the page I'll get an error in the console and the .active class in the navigation stops working:
Uncaught TypeError: Cannot read property 'element' of null
at Waypoint.$section.waypoint.offset [as callback] ((index):915)
at Waypoint.trigger (jquery.waypoints.js:59)
at Group.flushTriggers (jquery.waypoints.js:531)
at Context.handleScroll (jquery.waypoints.js:308)
at scrollHandler (jquery.waypoints.js:251)
$section.waypoint.offset @ (index):915
Waypoint.trigger @ jquery.waypoints.js:59
Group.flushTriggers @ jquery.waypoints.js:531
Context.handleScroll @ jquery.waypoints.js:308
scrollHandler @ jquery.waypoints.js:251
requestAnimationFrame (async)
Waypoint.requestAnimationFrame @ jquery.waypoints.js:476
(anonymous) @ jquery.waypoints.js:258
dispatch @ 6f03d58933ec.js:3
r.handle @ 6f03d58933ec.js:3
The line navActive(previousWaypoint.element.id); causes the error in the following section.
$section.waypoint(function(direction) {
if (direction === 'up') {
var previousWaypoint = this.previous();
if($(this.element).hasClass('onepage_article')) {
// change url to active link
navActive(this.element.id);
history.pushState("", "", '#' + this.element.id);
} else {
navActive(previousWaypoint.element.id);
history.pushState("", "", '#' + previousWaypoint.element.id);
}
}
When I try to install the extension via composer, I get the following message:
[InvalidArgumentException]
Could not find package ErdmannFreunde/contao-onepage-navigation at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability
I am using Contao 4.48 - what am I doing wrong?
Bei allen Installationen, bei denen ich das Modul einsetze, werden nicht nur die als "One Page Article" markierten und mit den entsprechenden Navigations-Einstellungen für das One-Page-Menü hinterlegten Artikel beim Scrollen als #Sprunkmarke in der Adressleiste des Browsers angezeigt, sondern alle auf einer Seite enthaltenen Artikel. Wenn ich also zur Gliederung mehrere Artikel angelegt habe, davon aber nur bestimmte Artikel in der One-Page-Navigation haben möchte, erscheinen die Sprungmarken dazwischen trotzdem.
Besonders unschön ist dabei:
Meine Erwartung wäre:
Viele Grüße
Timo
I have a page with the following structure:
If I want to have the Onepage menu on the subpages, so that I can get back to the landing page, I set the landing page as a reference page in the module.
But as a result I get links in the navigation like Page_2#Article_1 or Page_3#Article_2 and not as it should have been Landing_Page#Article_1.
Wenn man bei einem Artikel keinen Namen für eine Sprungmarke
eingibt, so wird im Frontend im entsprechendem <li>
nicht die CSS-Klasse active
vergeben und das Link-Attribut data-onepagelink
bleibt dementsprechend leer.
Wäre schön, wenn auch ohne Angabe einer Sprungmarke der aktive Menüpunkt durch eine Klasse gekennzeichnet wird.
Contao 4.13.13
PHP 8.1
Bundle 2.0.0
Beim Klick auf Als Navigationspunkt hinzufügen
(im Artikel) gibt der POST-Request zum Laden der Palette einen 400er Fehler. (vendor\contao\core-bundle\src\Resources\contao\classes\Ajax.php:L440)
Das Contao System-Log enthält: Field "addNavigation" is not an allowed selector field (possible SQL injection attempt)
Beim Ajax-Request scheint im __selector__
das Feld addNavigation
zu fehlen. Mir ist leider nicht klar warum das so ist.
Problem tritt auch in einem 2. System auf.
The code I provided in #7 works fine in all modern Browsers but not in Internet Explorer 11 if the content of the anchor is higher than the browser window. In this case it scrolls to the position where it should scroll to (anchor + fixed header) and than jumps up to the real anchor position.
If the content is only a couple of sentences and fits in the browser window without the need to scroll down to read all of the sentences - it works fine as well.
I could not find a solution for this problem.
Hallo,
ich habe gerade in einer Testinstallation eine Fehlermeldung erhalten.
Internal Server Error
Attempted to load class "Utf8" from namespace "Patchwork". Did you forget a "use" statement for another namespace?
In der Log-Datei finde ich die folgende Zeile:
[2022-02-25T11:02:06.352375+01:00] request.CRITICAL: Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\ClassNotFoundError: "Attempted to load class "Utf8" from namespace "Patchwork". Did you forget a "use" statement for another namespace?" at /.../vendor/erdmannfreunde/onepage-navigation/src/Modules/ModuleOnepageNavigation.php line 39 {"exception":"[object] (Symfony\Component\ErrorHandler\Error\ClassNotFoundError(code: 0): Attempted to load class "Utf8" from namespace "Patchwork".\nDid you forget a "use" statement for another namespace? at /.../vendor/erdmannfreunde/onepage-navigation/src/Modules/ModuleOnepageNavigation.php:39)"} []
Der Fehler tritt auf, wenn ich einen Artikel bearbeiten möchte (Stiftsymbol), in dem das Modul Onepage-Navigation eingebunden ist.
Unter Contao 4.9 gibt es das Problem nicht. Ich kann mit der Meldung nichts anfangen, denke aber es kann nicht schaden, es hier zu melden.
Falls ich bei der Lösung helfen kann, testen oder Zugang zur Testumgebung, mache ich das gerne.
Vielen Dank
VG
André
If you have the onepage-navigation (without reference-page) in layout but the page has no articles - the site will crash with following exception:
request.CRITICAL: Uncaught PHP Exception Error: "Call to a member function next() on null" at /var/www/vhosts/xxx/vendor/erdmannfreunde/onepage-navigation/src/Modules/ModuleOnepageNavigation.php line 74 {"exception":"[object] (Error(code: 0): Call to a member function next() on null at /var/www/vhosts/xxx/vendor/erdmannfreunde/onepage-navigation/src/Modules/ModuleOnepageNavigation.php:74)"} []
It would be nice if that could be catched somehow - it works flawlessly if there is just one unpublished article.
The regular navigation module has the settings "reference page" and "define root".
It would be nice to bring these settings back to your article navigation module.
Doing so, you should be able to place the navigation outside the page with the one page structure and still see the navigation items.
Please see this page. When you click on the page "Impressum", the navigation is gone but I would like to keep the navigation there.
I used
.onepage_article {
scroll-margin-top: 6rem;
}
to prevent content from sliping underneath a sticky/fixed header but the onepage_navigation.js uses offsetTop and does not consider scroll-margins.
I tinkered around to substract the margin but then i figured it's easier to just ditch these lines.
and optionally set scroll-behavior: smooth;
on the html element on init.
That would allow for css scroll-margins and for rare cases of horizontally scrolling layouts.
Habe die OnePager Navigation eingebaut (Contao 5.3). Nach dem Stylen der Menüzustände habe ich festgestellt, dass nicht immer der "active"-Zustand gesetzt wird. Erst, wenn ich im einzelnen ".onepage_article" jeweils ein großes Padding oben und unten hinzugebe funktioniert es, sieht aber dann sehr auseinander gezogen aus. Der Inhalt ist eigentlich grundsätzlich lang genug.
Die selbe Problematik hatte ich bei einer anderen Webseite auch. (Contao 4.9)
Ist das ein Problem oder Einstellungssache?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.