We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36870
    • 13 Posts
    So I just installed modX evolution 1.0.5 and everything seems to be installed successfully.

    I'm just having trouble understanding what file I need to get my dynamic pages to work.

    I have my template saved and I have a resource for it, then I try to link to it from my home page

    <a href="http://www.hairbarbiextensions.com/Hair-Extension-Details.php?id=2">Clip-Ins</a>

    and my resource being (2) in my tree right...

    I had this all working when I was using modX revolution, I had a .php file in the root of my server with some magical php code that when I renamed the file to my template name, I could link it up with the code up top and everything was running great, I had my TV's uploading and all that.

    Now I just dont seem to understand how to link my template thats somewhere in mysql land I imagine with my resource... Right now im trying to use the file I was using with revolution... not so much luck tho,

    site is http://hairbarbiextensions.com/ the clip-ins link is what I want dynamic... im just not understanding a critical peace of this elaborate puzzle.

    please help me, its not so much a technical issue so I dont think you need my specs. everything seems to be in order, it said modX installed successfully and all that... just a user issue, please advise smiley

    Thanks so much and I hope I made sense...

    This is the file that used to work for me with revolution and I named this file same as my template names.

    <?php
    $mtime= microtime();
    $mtime= explode(" ", $mtime);
    $mtime= $mtime[1] + $mtime[0];
    $tstart= $mtime;
    error_reporting(E_ALL | E_STRICT);
    if (!defined('MODX_API_MODE')) {
    define('MODX_API_MODE', false);
    }
    $modx_cache_disabled= false;
    @include(dirname(__FILE__) . '/config.core.php');
    if (!defined('MODX_CORE_PATH')) define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');
    if (!@include_once (MODX_CORE_PATH . "model/modx/modx.class.php")) {
    $errorMessage = 'Site temporarily unavailable';
    @include(MODX_CORE_PATH . 'error/unavailable.include.php');
    header('HTTP/1.1 503 Service Unavailable');
    echo "";
    exit();
    }
    ob_start();
    $modx= new modX();
    if (!is_object($modx) || !($modx instanceof modX)) {
    @ob_end_flush();
    $errorMessage = '<a href="setup/">MODX not installed. Install now?</a>';
    @include(MODX_CORE_PATH . 'error/unavailable.include.php');
    header('HTTP/1.1 503 Service Unavailable');
    echo "";
    exit();
    }
    $modx->startTime= $tstart;
    $modx->setLogLevel(modX::LOG_LEVEL_ERROR);
    $modx->setLogTarget('FILE');
    $modx->setDebug(E_ALL & ~E_NOTICE);
    $modx->initialize('web');
    if (!MODX_API_MODE) {
    $modx->handleRequest();
    } [ed. note: whaus77 last edited this post 15 years, 1 month ago.]
      • 36404
      • 307 Posts
      hi,

      i think you may have misunderstood a little what template and ressource are...
      you do not link to template but to pages... those pages using a template you choose in the template list when creating the page

      what happens when clicking on your clip-in link is that we go to a page that apparently is in a folder (a virtual one), what should mean that the page is a child of a hair extension details container, is it the case ?

      something funny, apparently most of your pages have a .html extension what suggests that it's the extension you've chosen in the smart url config, this hair extension details page has a .php extension... is it a modx page ? or is it an external page you're trying to link to ? if it's the case, you'll have to add a few lines in your htaccess as it's written to understand modx structure and, not understanding yours, throws a 503 error

      actually, we lack some explanation about your site structure to understand what happens

      have swing
        réfléchir avant d'agir
        • 36870
        • 13 Posts
        Basically I only have my index up right now, all the other pages arent uploaded at the moment.

        I'm just trying to do a mix of static and dynamic pages, all my info pages and what not are static but then I just want my details pages for my items in the store to be dynamic. so my resources would be my items. i.e. a hair brush is a resource with TVs of price, description, ect.

        not sure why its saying the pages exist when they really dont, thats strange to me but thats not what im concerned about. I just need to know how to get a template operating live on my server once its saved and linked with a resource. Im lacking the final step i guess?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          1. Create a template.
          2. Create a resource and assign it to use that template OR in the configuration set that template to be the default.
          3. Turn on Friendly URLs in the configuration
          4. Rename the ht.access file in the site root to .htaccess

          To link to an internal MODx page, use [~xxx~] as the href, where xxx is the ID of the resource. If you are using the Rich Text editor, highlight the link text and use the "add/edit link" button in the RTE's menu bar. The second field, "Link List", will give you a list of MODx resources you can select from to have the link created automatically.
          <a href="[~xxx~]">Link</a>

          Links to external (non-MODx) pages are ordinary HTML links.

          http://sottwell.com/how-templates-work.html [ed. note: sottwell last edited this post 15 years, 1 month ago.]
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 36404
            • 307 Posts
            hi,

            have a good look at susan's website, it's what we call in french a mine of info smiley

            but, first thing i'd like to know, is your index page a MODx page ?
            looking at the source code i'm not that sure as i do not recognize evo usual structure for images, js, css files
            nor do i recognize any wayfinder type of classes in your left menu
            something else, as you're working on it, i've seen you're trying to use modx link syntax without success, one more sign all this seems to be an out of modx page

            if not it would mean you've replaced the native evo index page with yours (that may be why you were speaking about that magic php you used in revo)

            if this is the case, is modx in a peculiar directory aimed at dealing only with what you call dynamic pages (actually, in a cms all the page are "dynamic" as the content is stored in the db, even if as simple as hello smiley)

            if things are what they feel like, you shoud not do this, take the wole content of your index page, put it in a template you'll call hometemplate or else, use this template for modx first ressource (the former basic install) put back modx index.php page
            you'll decide what you want to be able to edit and where you want to use modx wayfinder/ditto and so on in this page afterwards but, at least things should be able to work better, even between your modx and non-modx pages

            next thing to do i think, try to have all your links with or without the www, try not mixing (modx would not smiley, well just an seo issue but also a bit confusing for users

            have swing
              réfléchir avant d'agir
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Indeed, every page of a MODx site is actually the MODx installation's index.php page, which loads the MODx parser with a reference to which MODx resource has been requested. That's what the rewrite rules do; they convert a domain.com/page.html (or whatever suffix you've set in the configuration; .html is the default) to domain.com/index.php?q=page.html. The parser, loaded by the index.php page, uses the 'page.html' part to determine which resource is being requested; i.e. which resource has that alias. Then it determines which template the requested resource is assigned to use (if the page isn't served from the cache), fetches the template from the database, and begins parsing it looking for MODx tags, such as {{chunk-name}} and [*resource-value-or-TV*].

              So if your site's index page is not the MODx index.php, then MODx can't work.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org