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

    I’m not sure how to put this question because I think basically it cover two topic. Friendly URL and TV, but ....

    I have a catalog of product and I generate page where I get all products of one group (link is something like : www.blabla.com/index.php?id=5&groupId=4 and I get all cameras smiley , after that I can click on some products and get SamsungCam... www.blabla.com/index.php?id=5&groupId=4&productId=445

    after I turn on Friendly url I get something like www.blabla.com/Samsung.html&groupId=4 and
    www.blabla.com/Samsung.html&groupId=4&productId=445

    My question is what and how can I get url like
    www.blabla.com/Samsung.html- Cameras OR www.blabla.com/Samsung_Cameras.html and
    www.blabla.com/Samsung.html- QuickShoot OR www.blabla.com/Samsung_QuickShoot .html

    My filing is that have to be something with TV and some RewriteRule in .htaccess file

    any help or suggestion ??


    sorry for my English






      • 17554
      • 41 Posts
      Hi

      I rely need a help about this ...good link to similar topic will be ok

      help :’(
        • 7231
        • 4,205 Posts
        First you can remove the .html from the seo settings. just leave it blank to get www.blabla.com/Samsung_Cameras. But this will still show as www.blabla.com/Samsung_Cameras&groupid=6

        This has been discussed before but I do not remember a solution being reached. I think that there is nore to it than simply editing htaccess.
          [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't know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          However the query string is added has to take into account whether or not Friendly URLs is being used. If they are NOT being used, then the first delimiter has to be a &, since the starting ? is being used by the "index.php?id=xx" in the URL. If they ARE being used, then the first delimiter has to be the ?, since your URL will be someting like "page.html".

          Basically if the URL is being generated in a snippet or plugin, it needs to check for the value of $modx->config[’friendly_urls’], and use ? if that is set to 1, and & if it’s set to 0.

          There is a snippet that returns the ? or the & depending on this array element’s value, and you can use the snippet call if you’re manually entering links in your content (although you should know whether or not you’re using Friendly URLs).
            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
            • 17554
            • 41 Posts
            Sottwell

            I’m not sure that I understand complitly your post ... List of my group I get triught sniper ...

            global $modx;
            $pageOfGroup = isset($pageOfgroup ) ? $pageOfgroup : ’38’;
            $url = $modx->makeURL($pageOfGroup ); ----------------------create url of group

            $allUsssers= $modx->db->query("select * from ......");

            $all = array();
            while ($all[] = $modx->db->getRow($allUsssers)) {}
            foreach ($all as $key => $value)
            {
            if (empty($all[$key]))
            {
            unset($all[$key]);
            }
            }

            $nn=0;
            foreach ($all as $user)
            {

            $fci= $user[’FCI_group’];
            $fciGroupName = $user[’type_name_srp’];
            $Typename = $user[’name_srp’];
            $kenNum= $user[’NUM’];
            $fciSS = $user[’type_id’];

            print ("$fci group - $fciGroupName");

            print ("<a href=$url&fciSpec=$fciSS >$Typename ($kenNum)</a>"); ---- set the param for URL
            }

            I think I will need parametar in url. With this parameter I chooses what product group I need and after that what product...


            I was thinking is there any possibility to set TV with snipet and change the alias of document and than somehow make htaccess file with Rewrite rule to understand that huh

              • 28042 ☆ A M B ☆
              • 24,524 Posts
              What you need to do is use a bit of code to determine if friendly_urls is 0 or 1, and set a variable like $delim to be & if it’s 0 or ? if it’s 1. Then in the last line, where the actual link is created, use that variable instead of the first delimiter:
                    
              // use & if NO friendly urls, use ? if YES friendly urls
              $delim = ($modx->config['friendly_urls'] == 0) ? '&' : '?';  
              // use the $delim variable to determine the proper query string start delimiter
              print ("<a href=$url" . $delim . "fciSpec=$fciSS >$Typename ($kenNum)</a>");  ---- set the param for URL
              
                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
                • 17554
                • 41 Posts
                Sottwell

                thanks a million times grin

                if work like a charm BUT now I have one more quest huh

                now all links are like www.blabla/xxxxxx.html. where xxxxxx is document alias


                first I have extra point on the end of url (not a big problem but why?)
                and seccond is it possible to set alias of document programmaticly in snippet ?
                becouse I like that this URL look like

                xxxxxx1.html
                xxxxxx2.html
                etc ...

                maybe I start to be a pain in the ... smiley ?



                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  maybe I start to be a pain in the ... smiley ?
                  Not at all. If I know something, I respond. If I don’t, I don’t respond. No pain at all cool

                  Hopefully somebody else will have answers for your new questions.
                    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
                    • 17554
                    • 41 Posts
                    AAAAAAA

                    I open a botle to early

                    URL is ok , but the parametar is missing so every link act like there no param at all !!!

                    so how to pass parametar and url still be nice ?