Giter Club home page Giter Club logo

contao-onepage-navigation's People

Contributors

asaage avatar bastibuck avatar denniserdmann avatar ma3xl3 avatar rabauss avatar richardhj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

contao-onepage-navigation's Issues

j_onepage_navigation

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?

[Contao 5] Attempted to load class "BackendTemplate" from the global namespace.

[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)"} []

First menu item is always active

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.

Keine Funktion mehr nach Update auf 4.9.17

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

Scrolling on Touch Devices

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

module breaks the 404 error-page

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.

[Feature Request] Support for fixed header

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

article css without distance

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

Error when scrolling to top of the page

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);
                   }
        }

[InvalidArgumentException]

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?

Alle Artikel in Adresseleiste

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:

  • dass die URL dann Elemente wie #article-123 enthält
  • Diese einzelnen Punkte landen auch in der History
  • wenn ich also auf zurück klicke, springe ich alle Punkte erneut an, an denen ich nur vorbei gescrollt habe.
  • Wenn ich auf der Seite mehrfach hoch und runter gescrollt habe, landet der komplette Scrollverlauf in der History.

Meine Erwartung wäre:

  • Nur die als solche markierten Artikel erhalten eine Sprungmarke, also nur diejenigen, die auch im Menü angezeigt werden sollen
  • In der History erscheinen nur die angeklickten Elemente, nicht die, an denen nur vorbei gescrollt wurde und schon gar nicht diejenigen, die gar nicht als Menüelemente markiert sind.
  • Aus meiner Sicht sollte der Zurück-Button sogar überhaupt nicht die Onepage-Navigation berücksichtigen, sondern nur echte Seitenwechsel. Das wäre gut als Option.

Viele Grüße
Timo

Reference page does not work as expected

I have a page with the following structure:

  • Landing_Page (width onepage navigation)
    -- Article_1
    -- Article_2
    -- Article_3
  • Page_2
  • Page_3

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.

Aktiven Menüpunkt via CSS kennzeichnen ohne Angabe einer Sprungmarke

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.

image

Wäre schön, wenn auch ohne Angabe einer Sprungmarke der aktive Menüpunkt durch eine Klasse gekennzeichnet wird.

Ajax-Post-Action schlägt fehlt beim Laden der Subpalette `addNavigation`

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.

[Help needed] Support for fixed header

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.

C4.13 Attempted to load class "Utf8" from namespace "Patchwork".

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é

Pages without articles will cause an Exception

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.

Navigation module needs reference page

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.

scroll-margins being ignored

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.

#7

"active" wird nicht immer gesetzt

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.