Announcement

Collapse
No announcement yet.

Defaulting content types in new message window

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Defaulting content types in new message window

    Here's something I'd be keen to find a way to do, and I currently can't.

    I'd like to be able to add a "New Event" button on the new Calendar page.

    Now, I can actually add a button, and the logic used would be to create a "Calandar" forum and have it hidden, but make the button a link to the new topic screen for that specific forum.

    The issue is...how do you make a new topic window default to a specific content type? (In this case, events).
    I've tried limiting permissions down to just the event type, and even if you can that to work and only show the events icon (not easy in itself), the user still has to click it to bring up the event fields.

    I'm guessing there'd need to be a Javascript plugin to automtically activate it, but this is realistically beyond my skills to write.

    Anyone got any thoughts?

    #2
    You could pass a querystring parameter (e.g. ?default=event) in the Create New Topic page to indicate the default content type to show by default. Then you'd have a template hook containing javascript that retrieves the querystring parameter. Then the script will programmatically click on the appropriate content type icon.

    You can use that logic for any content type. You just pass the corresponding querystring parameter.

    ​​​​​
    Helpful? Donate. Thanks!
    Buy me a coffeePayPal QR Code
    Fast VPS Host for vBulletin:
    A2 Hosting & IONOS

    Comment


      #3
      Thanks Glenn, I'll have a play around and see if I can make that happen....

      Comment


        #4
        Each of the content type icons has this attribute in the HTML.

        Code:
        data-panel="b-content-entry-panel__content--xxxxx"
        where xxxxx is the type (gallery, poll, link or event)

        You could use that as the value for the querystring parameter and map it as the jQuery selector for the icon.

        Code:
        var qs = vBulletin.parseQueryString(location.href);
        var type = qs['default']; //get the 'default' querystring parameter value
        if (type) {
            $('.b-toolbar__item[data-panel="b-content-entry-panel__content--' + type + '"]').click();
        }
        Helpful? Donate. Thanks!
        Buy me a coffeePayPal QR Code
        Fast VPS Host for vBulletin:
        A2 Hosting & IONOS

        Comment

        Users Viewing This Page

        Collapse

        There is 1 user viewing this forum topic.

        • Guest Guest

        Latest Posts

        Collapse

        Working...
        X
        Searching...Please wait.
        An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

        Please push the back button and reload the previous window.'
        An unexpected error was returned: 'Your submission could not be processed because the token has expired.

        Please push the back button and reload the previous window.'
        An internal error has occurred and the module cannot be displayed.
        There are no results that meet this criteria.
        Search Result for "|||"