We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18330
    • 20 Posts
    Hi people.
    I need know if exist the posibility of show the document but not complete if i not logged in and show the document complete if i logged in.
    I’m not an expert in php but i need this yes or yes. i’m not an expert in english, i’m argentinian.
    Example
    User not logged in can see only the first paragraph of the document.
    User logged in can see the document complete.
    And i need the forms for register and for login.
    If exist the posibilities in the register form can add a number of credit card it be excelent.
    Thanks
      • 7231
      • 4,205 Posts
      Yes, it is possible. There are a few ways to do it, the easiest would be to use the a snippet to show the truncated content when not logged in and the full content when logged in. Another option would be to use PHx which can do this.
        [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]
        • 18330
        • 20 Posts
        Oh great. but you can send me the links or examples of this? i think i need the snippet, and the configuration for manage the feature of this. and how i can add the document to show to this form.
        Thanks

        P.D: i’m a newbie in modx sad
          • 3749
          • 24,544 Posts
          The Personalize snippet will show one chunk to logged-in users and another to not-logged-in users.

          Bob
            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
            Personalize is available as one of the default snippets during the install. PHx is a plug-in that allows you to have smart place holders to be able to add logic to do some cool stuff.
            Here is the PHx wiki: http://wiki.modxcms.com/index.php/PHx
            Here is a link to the word_limit extender used to truncate the output: http://wiki.modxcms.com/index.php/PHx/CustomModifiers#phx:word_limit

            You could do want you want by:
            [*phx:mo=`myWebgroup`:then=`[*content*]`:else=`[*content:word_limit=`10`*]`*]
            This says if member of myWebgroup then show content, otherwise limit content to 10 words.
              [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]
              • 10449
              • 956 Posts
              Another way is to simply use the introtext field for users who are not logged in. Perhaps with a custom chunk that shows a link to the registration / login page.

              e.g.
              [*phx:mo=`myWebgroup`:then=`[*content*]`:else=`[*introtext*] {{registerLink}}`*]
                • 18330
                • 20 Posts
                Hi, thanks for the quickly answer. but i have a new one. i created a page for the user can add to a web group, but it can’t work sad i have in the same page a sidebar with the quick login. can it do it? or i can a fix in the configuration of the forms?
                Here are the code in the page:
                [!WebSignup? &tpl=`FormSignup` &groups=`blog`!]
                and it in the sidebar
                [!WebLogin? &loginhomeid=`125` &logouthomeid=`127` &tpl=`FormLogin` !]

                really i have a problem with this.
                the idea is if the user has an user and pass go to the sidebar login and then he can see the all content, and if he not has logged in, go to the account page and create a new one account, but when i make the prove the modx, answer me the username does not exist :S
                thanks for all
                  • 18330
                  • 20 Posts
                  Hi again and sorry for my newbie’s question.
                  When i installed the plugin and activate the system say the next:
                  « MODx Parse Error »
                  MODx encountered the following error while attempting to parse the requested resource:
                  « PHP Parse Error »

                  PHP error debug
                  Error: include_once(/home/develop/public_html/.../assets/plugins/phx/phx.parser.class.inc.php) [function.include-once]: failed to open stream: No such file or directory
                  Error type/ Nr.: Warning - 2
                  File: /home/.floatsom/.../manager/includes/document.parser.class.inc.php(745) : eval()’d code
                  Line: 10

                  Parser timing
                  MySQL: 0.0156 s (3 Requests)
                  PHP: 0.0382 s
                  Total: 0.0537 s

                  Really i need this plugin for show the content how i say in the old post :S thanks for all
                    • 7231
                    • 4,205 Posts
                    Did you copy the phx folder to the /assets/plugins/ folder?

                    The error says that it cannot find the include file, generally this is because the file does not exist. To install PHx there are two steps 1) copy the PHx folder to the plug-ins folder; and 2) create the plug-in in the manager plug-in interface.
                      [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]
                      • 18330
                      • 20 Posts
                      Yes, i create a phx folder and copy all with the insctructions, and create a plugin but it can’t work :S maybe i not sure if the configurations of htaccess are right, but the friendly url works, the eform work too, but the phx plugin can’t work. is very strange.
                      if you need see any configuration of the modx, please tell me and i paste here the code, thanks for your help



                      Sorry, i can fix the problem, the url in the tools-configutarion-assets are wrong, i fixed this and work correctly, thanks for all.

                      The code work correctly and the form too.
                      Thanks a lot