We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36668
    • 26 Posts
    Hi,

    Little explanation first

    i am new to modx and also (re)learning web design so not sure if this is a modx problem. Also i realise that i maybe/probably going about it the wrong way , but before really understanding CMS’s i thought this was the way they worked...or the way I wanted them too work.

    this is how i have my website set up.

    www.domain.co.uk/mywebsite/ <----- my website is in this folder

    www.domain.co.uk/modx/ <------ this is where i installed modx


    The Problem

    I have made my website using the php includes. on 2 of the pages i have DIVS that use the phpinclude command to display 2 pages i have made in modx.

    now when i view the pages of my website that have the modx made pages in, i have run into some problems with various browsers :

    IE7 - doesnt display the pictures, when i view the links they are pointing to www.domain.co.uk/mywebsite/assets/images instead of www.domain.co.uk/modx/assets/images in firefox this is not effected i can view the pictures.

    Opera - when i navigate to one of the pages which has the modx page being displayed it seems to mess up the navigation links i have , I think it inherits the base_url which is in the template of the modx document.

    firefox 3 - seems to work ok.

    "When i view the modx site directly it all works fine, i only run into problem when i start viewing in my static site which is out side of modx"

    like i mentioned above, i realise i might be going about this the wrong way, but i was hoping that i could just make 2 pages in modx and have them display them in the the site i already have made by using the "phpInclude".

    some topics i have read on the forums hint at a solution (i think) but quite frankly loose me. stuff like modifying the .htaccess file.

    i hope i have been clear enough and would appreciate any help

    thanks

    Tim
      • 7231
      • 4,205 Posts
      You need to include the <base> tag in the html header section in the modx site.

      <base href="http://yourdomain.com/"></base>
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don&#39;t know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 36668
        • 26 Posts
        dev_cw thanks for the post but it doesnt seem to work or i am still doing something wrong.

        i will post a link to the site showing you/anyone what is happening.

        "I HAVE TAKEN DOWN THE LINKS AS I HAVE FOUND A DIFFERENT WAY OF DOING IT"


        if you view it in Firefox it all seems to work ok.

        the problems are in:

        IE7 - not showing the image.

        Opera - image displays BUT once you go to the kittens page and try to go to any other page after that the links are messed up. (seems to me that it is inheriting the link structure if that makes sense)

        safari - same problem as Opera

        Like i have said before this might not be a modx problem and also i am still very much learning web design.

        your help is really appreciated.

        Tim
          • 27330
          • 884 Posts
          You using friendly urls?
          if yes u need in your modx dir .htaccess

          #Options +FollowSymlinks
          RewriteEngine On
          RewriteBase /modx/
            • 7231
            • 4,205 Posts
            I think that your problem may be related to some issues in the html of the site. At first glance there is some body markup inside the head section of the html, there are two <head> sections, and the doctype is being declared in a <ul> tag (?).

            I am thinking that some browses are more forgiving than others with these problems, this would explain why it works in some and not in others. I recommend running the page through a html validator to help identify the errors.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don&#39;t know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 36668
              • 26 Posts
              sinbad

              You using friendly urls?
              if yes u need in your modx dir .htaccess

              #Options +FollowSymlinks
              RewriteEngine On
              RewriteBase /modx/


              No i am not using friendly urls.  thanks for the input though.

              dev_cw - I have cleaned up the code and it only brings up 1 error now which i dont think will effect modx.  but thanks for the suggestion.


              I may have one more way of trying to get it to work although it doesnt fill me with hope.

              I think what i want to do is not possible maybe.

              basically Run my static site seperate  and  run a modx site seperate and just use the php include command to call the pages i want from the modx site.

              the other option is i might try and import the site into modx and use modx the way it should be used, although i would at the moment prefer the former way for the time being.

              Thanks

              Tim 
                • 3749
                • 24,544 Posts
                If you are using Wayfinder for your menu, is the Wayfinder call uncached in your template?

                 [!wayfinder!]


                It should be.

                You should also definitely get rid of the extraneous </base> tag in line 7 and fix the character encoding so the specification in the file matches the header.

                change
                charset=iso-8859-1
                to
                charset=utf-8
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 36668
                  • 26 Posts
                  Thanks for the reply, but i think my problem lies with me using the <?php include(’’); ?> command. I am going to look into maybe doing it a different way or just porting my site over to modx. unless anyone else has any ideas

                  thanks for everyones help.

                  Tim