Announcement

Collapse
No announcement yet.

Static HTML Module and vBulletin strings

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Static HTML Module and vBulletin strings

    Is it possible to use the vBulletin strings
    Code:
    {sitename}, {userid}, {username}, {musername}, {registerurl}, {activationurl}, {helpurl}, {contacturl}, {homeurl}, {date}.
    in a static HTML page? I am building a landing page and wanted to address the member by their username to make the page less generic. Is this possible? If so, how? If not, do you have an idea how to accomplish something like this? I wondered about the PHP page, but have little experience creating code.

    Basically, I'm looking to do something like:

    Welcome {username},thank you for ....

    Kind regards,
    K

  • #2
    If you have self hosted forum you could create a new template and use the template widget. Unfortunately you could use variables only if you have self hosted forum in templates.

    Comment


    • #3
      Originally posted by delicjous View Post
      If you have self hosted forum you could create a new template and use the template widget. Unfortunately you could use variables only if you have self hosted forum in templates.
      I do have a self hosted forum. Can you link me to instructions on how to create a new template and use the template widget? Thank you!
      K

      Comment


      • #4
        What exactly are you looking to do here?
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment


        • #5
          Originally posted by Wayne Luke View Post
          What exactly are you looking to do here?
          Basically, I'm looking to create a page that when visited, would address the member by their name {username} instead of a default greeting like (hello member). I would like to be able to layout the page using HTML as I understand how to do that, but I don't see a way to use the vb strings or custom profile fields (for that matter) within a static HTML page (or if that is even possible). I'm hoping it is since these pages are integrated into the vbulletin software and not some add-on working as a separate product. Since there is not an editor in the module creation/edit area, I use notepad to create the styling and layout of the content for the page but do not know how to use the vbstrings outside of the phrase manager in the admincp (for example).

          In the short term, in order to get my site ready for the move to VB5, I need to create some basic pages to replace some functionality that will be lost with out external products that were created for my site. I would like to be able to use the the vbstrings and perhaps even the user profile field ids to create a more directed experience for the person viewing the page. Eventually, I can see removing my wordpress site that surrounds my forum and building all the pages and content inside the vb5 software. (Exciting!) Anyway, in simplest form, right now, I need to do something like this:

          "Welcome {username}, blah, blah..."

          Cheers,
          K

          Comment


          • #6
            You can't use the shortcodes within templates at this time. You would have to figure out the variable and parse it to have it show. This can be complicated. So I suggest doing the following:

            Before we get started, put your site into Debug mode...

            First step... Create a custom product.
            1. Go to Products & Hooks -> Product Manager.
            2. Click "Add/Import Product."
            3. Fill out the add form. Just make the Product ID and Product Title unique. Make the Product Title memorable so you know what it does. Set the version to something like 1.0 and the description to tell what it does. The last two don't need any values.
            4. Save the page.
            Click image for larger version

Name:	2019-11-24_17-06-10.png
Views:	157
Size:	21.0 KB
ID:	4427859
            Create a new product



            Second, we're going to create the text of the page using shortcodes and HTML.
            1. Go to Languages & Phrases -> Phrase Manager.
            2. Click "Add New Phrase"
            3. Set the Product to the value for the product you created above. It will be listed in the drop down.
            4. Give it a unique varname.
            5. Enter in your HTML in the "Text" box. Use whatever shortcodes you want.
            6. Save the Phrase.
            Click image for larger version

Name:	2019-11-24_17-11-57.png
Views:	87
Size:	56.8 KB
ID:	4427860
            Creating a custom phrase.



            Next, we're going to create our template to show this phrase.
            1. Go to Styles -> Style Manager.
            2. In the "MASTER STYLE", choose "Add New Template" in the Choose Action Drop Down.
            3. Set the Product to the product we have been creating.
            4. Give it a unique title.
            5. Then enter the following code for your template:
            Code:
            <div>
                {vb:phrase custompage_phrase}
            </div>
            When done save the template.
            Click image for larger version

Name:	2019-11-24_17-19-28.png
Views:	86
Size:	35.2 KB
ID:	4427861
            Create custom template


            Finally, let's put it on a page.
            1. At the top of the AdminCP, click "Site Home Page".
            2. If Necessary, click the "Edit Site" toggle so that Site Builder is on.
            3. Click "New Page".
            4. On the Layout tab, select "Full."
            5. On the Module tab of the page editor, drag the Page Name module to the page in the first dotted line section. It is in the Display category.
            6. On the Module tab of the page editor, drag the Display Template module to the page in the second dotted line section. It is in the Generic category.
            7. Edit the Template Display module by clicking on its pencil.
            8. Give it a title.
            9. Set the display sizes if necessary.
            10. Set it to "Hide Title"
            11. Set the Template Name to the one we create above.
            12. Save the module.
            Click image for larger version

Name:	2019-11-24_17-29-33.png
Views:	85
Size:	93.8 KB
ID:	4427862
            Set our page modules and edit the Display Template module.


            Save the page. You will need to enter at least two values here. Page Name and Template Name. For convenience I would make them the same. Edit the other values as you see fit. The system should load your new page when it saves an you'll see the result:
            Click image for larger version

Name:	2019-11-24_17-38-03.png
Views:	84
Size:	34.0 KB
ID:	4427863



            When done, turn off debug mode by setting the values in your config.php files to false. This seems like a bunch of steps but will preserve your changes through upgrades and allow you to use the shortcodes.
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API

            Comment


            • #7
              I've also created a feature request to add the shortcodes to the Static HTML Module here: https://tracker.vbulletin.com/vbulle...sues/VBV-19868
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud demonstration site.
              vBulletin 5 API

              Comment


              • #8
                Wayne Luke Thank you. You went above and beyond. I cannot begin to tell you how much this helps me. Sincerely, thank you sir!

                Kether

                Comment

                Related Topics

                Collapse

                Working...
                X