We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1343 ☆ A M B ☆
    • 2,213 Posts
    Hello,

    I’m trying to use wayfinder to create a section guide on a site, but ran into a snag... Weblinks don’t have the Summary (introtext) field that I have been using to create text for the guides. Is there any drawback to using the description field to hold say 4 sentences of text?

    Thanks
    AMDbuilder
      Patrick | Server Wrangler
      About Me: Website | Tweets |  MODX Hosting
      • 7231
      • 4,205 Posts
      I thought that had been changed a while back. The introtext field is available just not included. It is an easy modification to make it available (I have done it before as a test but will need to look for my notes). Maybe if we add this to Jira it will make it’s way into official release.

      Another option is to use a TV for the summary. Weblinks are allowed templates so TVs will work. If you are already using the summary field throughout your site and are comited, you can toss in a bit of logic (PHx or snippet) to "if no summary text use tv value" for the weblinks, or maybe even better "if type is weblink get TV value, else get introtext".
        [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]
        • 1343 ☆ A M B ☆
        • 2,213 Posts
        Hello,

        It would be great to have this added to an official release, but in the mean time do you know how I could add it now? I will make a note in Jira in the near future.

        Thanks
        AMDbuilder
          Patrick | Server Wrangler
          About Me: Website | Tweets |  MODX Hosting
          • 3749
          • 24,544 Posts
          Quote from: AMDbuilder at Jan 09, 2009, 09:15 PM

          Is there any drawback to using the description field to hold say 4 sentences of text?

          The description field is varchar (255), so you could easily run out of room there. The introtext field is set to "text" so it would hold anything you’d be likely to throw at it.
            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
            • 1343 ☆ A M B ☆
            • 2,213 Posts
            That’s what I figured, so I guess it comes back to getting the summary field to show up for weblinks.

            Any suggestions on that front?
            AMDbuilder
              Patrick | Server Wrangler
              About Me: Website | Tweets |  MODX Hosting
              • 3749
              • 24,544 Posts
              I think I found where it would go, but please be aware that I’m making this up as I go along. wink

              In the file manager/actions/mutate_content.dynamic.php around line 580 (I think this is MODx 0.9.2, so it might not be the same if you’ve upgraded).

              <?php if($content['type']=="reference" || $_REQUEST['a']==72) { ?>


              I believe the code following that is the display for weblinks. The "else" statement below that is for regular documents.

              Be sure to back up that file before playing around!

              One thing to try would be to just change that if statement to if(false). Then weblinks should be treated as regular documents and you’d get all the fields. A trickier fix would be to edit that first section to add the summary/introtext field based on what’s in the "else" section.

              In either case, I don’t know if the summary/introtext field would be saved or what kind of side effects this might have, so be sure to test it very thoroughly on a sandbox site.

              This would be *way* easier in Revolution. wink

                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
                • 7231
                • 4,205 Posts
                One thing to try would be to just change that if statement to if(false). Then weblinks should be treated as regular documents and you’d get all the fields. A trickier fix would be to edit that first section to add the summary/introtext field based on what’s in the "else" section.

                I think that if you remove the else statement the link tree will show in the standard documents.

                I copied the introtext part from the else statement (it is the entire else statement) and added it directly above the weblink selector (after the closing ?> tags after the // Web Link specific comment). Tested and it worked perfect saved and returned the data as expected.

                	// Web Link specific
                ?>			<tr style="height: 24px;"><td valign="top" width="100" align="left"><span class="warning"><?php echo $_lang['document_summary']?></span></td>
                				<td valign="top"><textarea name="introtext" class="inputBox" rows="3" style="width:300px;" onchange="documentDirty=true;"><?php echo htmlspecialchars(stripslashes($content['introtext']))?></textarea>
                				  <img src="media/style/<?php echo $manager_theme?>images/icons/b02_trans.gif" onmouseover="this.src='media/style/<?php echo $manager_theme?>images/icons/b02.gif';" onmouseout="this.src='media/style/<?php echo $manager_theme?>images/icons/b02_trans.gif';" alt="<?php echo $_lang['document_summary_help']?>" onclick="alert(this.alt);" style="cursor:help;" spellcheck="true"/></td></tr>
                			<tr style="height: 24px;"><td><span class="warning"><?php echo $_lang['weblink']?></span> <img name="llock" src="media/style/<?php echo $manager_theme?>images/tree/folder.gif" width="18" height="18" onclick="enableLinkSelection(!allowLinkSelection);" style="cursor:pointer;" /></td>
                				<td><input name="ta" type="text" maxlength="255" value="<?php echo !empty($content['content']) ? stripslashes($content['content']) : "http://"?>" class="inputBox" style="width:300px;" onchange="documentDirty=true;" />
                				  <img src="media/style/<?php echo $manager_theme?>images/icons/b02_trans.gif" onmouseover="this.src='media/style/<?php echo $manager_theme?>images/icons/b02.gif';" onmouseout="this.src='media/style/<?php echo $manager_theme?>images/icons/b02_trans.gif';" alt="<?php echo $_lang['document_weblink_help']?>" onclick="alert(this.alt);" style="cursor:help;" /></td></tr>
                <?php } else {
                	// Document specific
                  [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]
                  • 3749
                  • 24,544 Posts
                  I think you’re right. That looks like a good solution.
                    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