We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3730
    • 8 Posts
    current version: MODx Revolution 2.0.0-pl rev7212 (to be updated to 2.02)

    hi there.
    we have a little problem with our website: www.meyerdudesek.com
    we are mainly architects/3d-designers and no web developpers, but are intersted enough to do such things by ourselves, so please excuse me for not beeing a professional on that field.
    the page is basically a port from our old flash only site. the problem is that we acted to fast setting it up. I did the modX setup with a basic wayfinder call and cms while a mootools scripter did the fancy part.
    however everything works nice except the url handling: dead links for example will not reach the 404 page. The whole modx/mootols construct was our idea beacuse we thougt we will be more flexible that way (instead of getting a customized cms by the scripter himself). the script therefore had to be a bit "hacky". anyway, the scripter did an impressive work, but now we are concerning about google cannot reach our subpages because of the javascript (not sure), and if so, the direct links to projects will not reach those pages and sometimes will make the page unfunctional.
    so I contacted the scripter again to solve those problems and it seems that I have to do some tweaks in modx. this is part an e-mail:

    when i made the JS code, your setup was:


    1. //////
    architecture page => { [ links ] [ content about architecture ] }
    3d page => { [ links ] [ content about 3d ] }
    and so on...
    //////

    as you can notice, every page has the links on its left. meaning,
    we’re always loading whole pages every time (like how html was made
    without PHP or iframes or whatnot).
    because of this behavior, i had to make a workaround provided that it
    is uniform for every page we load that the links are also there. i
    basically remove all in the loaded pages except the content part.
    i admit that the way i dealt with it is hacky (voodoo), but since we
    wnat to implement modx to it and that’s how we knew it worked, i made
    the JS as such.

    however, what i am hoping to be done is this:

    2. //////
    index/main page => { [ links ] [ content snippet ] }

    content snippets:
    - architecture page => [ content about architecture ]
    - 3d page => [ content about 3d ]
    - and so on...
    //////

    basically we have a main page with the links on it and an empty
    content div. this content div will be filled with snippets of the page
    requested by the viewer. so the all content of each page are stored in
    its own snippet which simply gets called into the main page. using the
    URL as our variable, i hope modx can make it such that whatever URL is
    searched in the site, the PHP part can throw the appropriate content
    snippet onto the empty content div.

    to be clear, when the viewer gets to the site via a link, the first
    time it needs a content snippet to get loaded, PHP will take care of
    putting it.
    (e.g. when viewer goes to http://meyerdudesek.com/architecture/, the
    PHP will appropriately take it to the architecture page )

    however, when it clicks another link while the viewer has not
    refreshed the page, the JS will now step in, and whatever link gets
    clicked, the corresponding content will be placed in via JS. for
    example, from the architecture page, the person goes to the 3d page,
    the URL will become http://meyerdudesek.com/architecture/#3d (note the
    use of # and the 3d after that). in this setup, we’re emulating how
    facebook page loading works. if the person reloads the
    meyerdudesek.com/architecture/#3d, the person will be redirected to
    meyerdudesek.com/3d to lay off the #.

    that is my plan on doing. it would’ve been easy if we did this from
    scratch. but given that it isn’t, i’m only hoping that your tweaking
    on modx will make the site work like how i’ve said it just now.


    ------

    so now my question. is this possible in modx and if so, how?

      • 4172
      • 5,888 Posts
      das mit dem content laden ginge schon. Aber das ist nicht das Problem, denke ich.
      Nicht in modx müßte da etwas umgabaut werden, sondern am JS-code müßte einiges gedreht werden.
      z.B. auf Eurer 404-Seite. Die wird schon aufgerufen. Aber dort arbeitet ja das gleiche script, welches aus dem wayfinder-generierten Menü dne ersten link ausliest und den location.hash entsprechend setzt. Scheinbar an anderer Stelle läd es dann den Content aus der im hash abgelegten Seite. Oder so ähnlich. 
      So genau hab ich das jetzt noch nicht untersucht. Da müßte man mal noch etwas mehr Zeit investieren, um den genauen Ablauf nachvollziehen zu können.
      
      wenn Ihr z.B. auf Eurer Fehlerseite mal testweise ein eigenes script einbaut mit dieser Änderung:
      
      				setHash : function(h)
      {
      this.currentHash = h;
      console.log(h);
      //location.hash = h;// Zeile mal auf der 404-Seite auskommentieren
      }
      <br /><br />ist die dann normal erreichbar?<br /><br />Google-Translate (isn’t translatet very well):<br /><br />loading content-only with ajax is possible,of course. But this is not the problem, I think.<br />Not in modx would be something todo, but at JS-code.<br />e.g. on your 404 page. Which is already called. But working there so the same script, which reads link from the wayfinder-generated menu dne first and location.hash accordingly sets. Apparently loads elsewhere then the content from the hash stored in the page. Or something like that.<br />I’m so exactly that examines not yet. As one would sometimes even spend some more time to understand the exact process can.<br /><br />for example if your on your error page views as its own test script installs with this update:<br /><br />
       setHash: function (h)
      (
      this.currentHash = h;
      console.log (h);
      / / Location.hash = h / / comment out line views on the 404-page
      )
      <br /><br />is then normally attainable?<br /><br />[Edit]<br /><br />ok, no this doesn’t work. there is todo more than that on your script for 404-page<br />
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!