We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32982
    • 674 Posts
    Quote from: iusemodx at Jan 23, 2015, 01:11 AM

    I have just modified again
    placeholder="'. $number .'"

    I also added a hover effect for the table rows.
    I have updated the code to HTML5
    I have modified the Actions area text for better understanding of each option.
    Thanks for all your work, now on the new SuperPage 4.0.0-rc5

    Best regards, Jabier.
      Jabiertxof (formerly XYZVISUAL)
      My bussines: http://marker.es
      https://www.youtube.com/user/jabiertxof/videos
      • 32982
      • 674 Posts
      Added default evolution buttons to save or cancel. in 4.0.0-rc6
        Jabiertxof (formerly XYZVISUAL)
        My bussines: http://marker.es
        https://www.youtube.com/user/jabiertxof/videos
        • 13226
        • 953 Posts
        @Jabier

        Updated:

        This produces a double slash "//"
        $theme = ($theme <> '') ? '/' . $theme : '';

        So I removed the slash
        $theme = ($theme <> '') ? '' . $theme : '';

        This adds the buttons inside the table, but in a position which is techy not allowed and one of the $theme tags is missing - also added the alt tags to the images and put the "$_lang" in them.
        $form.='	<div id="actions">
                  		<ul class="actionButtons">
                      		<li id="Button0">
                        		<a onclick="documentDirty=false; document.sitestatus.submit();" href="#">
                            		<img src="media/style/MODxRE/images/icons/save.png"> '.$_lang["save"].'
        						</a>
                      		</li>
                            <li id="Button1">
        						<a onclick="document.location.href=\'index.php?a=106\';" href="#">
        							<img src="media/style/'.$theme.'/images/icons/stop.png"> '.$_lang["cancel"].'
        						</a>
        					</li>
                		</ul>
            		</div>';
        $form.='</tbody></table></div></div></form>';

        So changed to:
        $form.='</tbody></table></div></div></form>';
        $form.='<div id="actions">
          <ul class="actionButtons">
            <li id="Button0"><a onclick="documentDirty=false; document.sitestatus.submit();" href="#"><img src="media/style/'.$theme.'/images/icons/save.png" alt="'.$_lang["save"].'"> '.$_lang["save"].'</a></li>
            <li id="Button1"><a onclick="document.location.href=\'index.php?a=106\';" href="#"><img src="media/style/'.$theme.'/images/icons/stop.png" alt="'.$_lang["cancel"].'"> '.$_lang["cancel"].'</a></li>
          </ul>
        </div>';


        A problem:

        For me, when I click the "Save" button nothing happens - I get a JavaScript Error: "TypeError: document.sitestatus is undefined"

        This happens with and without my changes, the cancel button works.

        A question / request:

        Is it possible to add an option to add the ID to the new documents dynamicaly using lets say a "-" e.g. 209-aliasname
          • 32982
          • 674 Posts
          Quote from: iusemodx at Jan 24, 2015, 03:59 PM

          Is it possible to add an option to add the ID to the new documents dynamicaly using lets say a "-" e.g. 209-aliasname
          I dont undertand well this, all other questions fixed on 4.0.0-rc7.

          Thanks for the review!
            Jabiertxof (formerly XYZVISUAL)
            My bussines: http://marker.es
            https://www.youtube.com/user/jabiertxof/videos
            • 32982
            • 674 Posts
            Also im thinking seriously in do a mayor update to this snippet.

            • Select parent at start like docmanager->sortmenu
            • Show the current items with filled values
            • A js toogler to active the value to change, can be used in multiple values
            • Ability to add more pages and fill it in the same way
            • Sort the pages
            • Add also add values to change content,template and templatevars
            This is in my mind...
            Maybe can be merged on DocManager.
              Jabiertxof (formerly XYZVISUAL)
              My bussines: http://marker.es
              https://www.youtube.com/user/jabiertxof/videos
              • 13226
              • 953 Posts
              @ Jabier

              Now working - great stuff. One change hasn't taken affect:

              This line of code:
              $form.='</tbody></table></div></div></form>';

              Needs to be placed before this block of code:
              $form.='<div id="actions">
              			<ul class="actionButtons">
              				<li id="Button0">
              					<a onclick="documentDirty=false; document.superPage.submit();" href="#">
              						<img src="media/style/'.$theme.'/images/icons/save.png" alt="'.$_lang["save"].'"> '.$_lang["save"].'
              					</a>
              				</li>
              				<li id="Button1">
              					<a onclick="document.location.href=\'index.php?a=106\';" href="#">
              						<img src="media/style/'.$theme.'/images/icons/stop.png" alt="'.$_lang["cancel"].'" > '.$_lang["cancel"].'
              					</a>
              				</li>
              			</ul>
              		</div>';

              Otherwise you get HTML errors - I know it's not the main priority, but I have already found clean correct code always helps to help find any errors. [ed. note: iusemodx last edited this post 9 years, 4 months ago.]
                • 13226
                • 953 Posts
                To the ID thing:

                I have created lets say products for clients in the past where a page ID and the alias have been needed - having them in the URL has proven to be a plus.

                Example:
                Lets say I want to make a gallery of products or images or files.

                Step 1: I create 500 pages using SuperPage.
                Step 2: The names of some products etc. are the same, so I have to manualy add something
                Step 3: I search through all of the 500 newly created documents and find the duplicates
                Step 4: I change the Alias of the duplicate files to ID + Alias Name e.g. 123-myaliasname
                Step 5: I modify my form(s) to accomodate the new alias

                The better way:

                If SuperPage had an option "Add Document ID To Alias" I would only need one step

                Step 1: I create 500 pages using SuperPage and SuperPage adds the ID automatically to all documents
                Step 2: Finished here

                SuperPage already adds the PageTitle as the alias, so the addition would add the newly created documenst ID as well, only if the option is chosen, otherwise SuperPage simply uses the pagetitle as normal.

                So basically:

                Without the option document ID => domain.com/myalias.html
                With the option document ID => domain.com/123-myalias.html

                I have created a quick mock-up - please see attached image => Add ID To Alias.jpg
                  • 32982
                  • 674 Posts
                  Quote from: iusemodx at Jan 24, 2015, 10:32 PM
                  @ Jabier

                  Now working - great stuff. One change hasn't taken affect:

                  This line of code:
                  $form.='';
                  ...

                  Done in rc8
                    Jabiertxof (formerly XYZVISUAL)
                    My bussines: http://marker.es
                    https://www.youtube.com/user/jabiertxof/videos
                    • 32982
                    • 674 Posts
                    Quote from: iusemodx at Jan 24, 2015, 11:02 PM
                    To the ID thing:
                    Without the option document ID => domain.com/myalias.html
                    With the option document ID => domain.com/123-myalias.html

                    Done in rc8.
                      Jabiertxof (formerly XYZVISUAL)
                      My bussines: http://marker.es
                      https://www.youtube.com/user/jabiertxof/videos
                      • 13226
                      • 953 Posts
                      @ Jabier

                      I just installed the latest version - all works, BUT:

                      On pressing the save button I get "JavaScript Error: ReferenceError: toggleNode is not defined" but the documents are saved as they should be.

                      Cheers