HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How Do I Edit Vanilla's HTML Completely?

I am new to Vanilla and have looked at making small html/css modifications through the editor, but what I am trying to do is change the "New Discussion" template to have more fields than just the category, discussion title, ,tags, and description. I want to include some drop downs and more text boxes. Is that possible with Vanilla Open Source?

Comments

  • hgtonighthgtonight ∞ · New Moderator

    Welcome to the community!

    Check out the addon Discussion Extender: https://vanillaforums.org/addon/discussionextender-plugin

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Thanks a ton! That will be very useful. I'm also a developer, so I am wondering how I can edit and make my own plugins, or what files I can edit to add new features of my own. I looked through the files and I couldn't really find anything that resembled html. I've heard that it's all php and no actual html, so where would that php segment be that you edit? Looking forward to working with the Vanilla open source.

  • hgtonighthgtonight ∞ · New Moderator

    Vanilla uses an MVC framework with a pluggable event system. Plugins can hook into any event fired off and execute its code, including spitting out HTML. The default applications fire events at pretty much every "interesting" point already.

    Vanilla uses both Smarty templates and PHP files for it's views. The Smarty templates are almost exclusively used for master views rather than component views.

    Back when I was getting started, the single most useful development tool was a plugin called Eventi: https://vanillaforums.org/addon/eventi-plugin

    It hooks into every event and lists the name of the event along with all the event arguments.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited May 2016

    You can use these very useful plugins to edit the template using html

    https://vanillaforums.org/addon/htmledit-plugin

    Then you can use the CSSEdit plugin to tune the style

    https://vanillaforums.org/addon/CSSedit-plugin

    I am wondering how I can edit and make my own plugins, or what files I can edit to add new features of my own

    Reading the docs would help answer all of the questions… then we can help you apply what you learned. Read the Tutorial Category please.

  • I'm editing the Tagging plugin because I want to make the Discussion Title be generated by tags. How can I edit the Discussion template so I can replace it with the tags textbox?

  • @okhawaja said:
    I'm editing the Tagging plugin because I want to make the Discussion Title be generated by tags. How can I edit the Discussion template so I can replace it with the tags textbox?

    So if there was a "help" tag, every discussion would be named "Help". seems counter productive to me.

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • okhawajaokhawaja New
    edited May 2016

    @River said:

    @okhawaja said:
    I'm editing the Tagging plugin because I want to make the Discussion Title be generated by tags. How can I edit the Discussion template so I can replace it with the tags textbox?

    So if there was a "help" tag, every discussion would be named "Help". seems counter productive to me.

    There are theoretically 2 groups of tags I have in mind. One group of tags contains names of cities around the world. The second group of tags contains activities such as Fishing, Attractions, Night Life, etc. I'm trying to understand how the Discussion Extender plugin works so that I can break the Discussion Title into 2 segments: Drop down with names of cities (user must choose a city name) and some tags to discuss the activities such as Fishing, Attractions, etc. When user hits submit, the entry from dropdown gets inserted as a tag inside the Discussion Title and then the other tags that follow are activities.

    Discussions may have the same titles, but that's not a problem for my use-case.

  • RiverRiver MVP
    edited May 2016

    plugin 1.
    Can you set up two dropdown fields with the discussion extender.

    plugin 2
    Before the save event for the discussion - concatenate the two fields from the extender and replace the discussion title in the form and also submit tag to tag database if not already there.

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • @River said:
    plugin 1.
    Can you set up two dropdown fields with the discussion extender.

    plugin 2
    Before the save event for the discussion - concatenate the two fields from the extender and replace the discussion title in the form and also submit tag to tag database if not already there.

    I'm confused as to how I can hide the default Discussion Title, so I can prevent people from filling it?

  • Nvm....I found that "applications/vanilla/views/post/discussion.php" has what I need to edit.

  • I don't know what happened.....but now I can't delete a discussion or do anything to it because it gives the error "DiscussionController->Discussion not found."...I also downloaded the Voting plugin but when I hit up or down arrow, the counter doesn't go up or down, but after refreshing it does show the changes of vote.

  • R_JR_J Ex-Fanboy Munich Admin

    You have mentioned elsewhere that you’ve passed the project to a developer, but nevertheless I would like to stress (again and again and again), that changing Vanilla functionality is not done by editing core files but by creating a plugin or a custom theme.

    I just wanted to add this, if anybody stumbles across this discussion later on…

  • I've replaced the controller and view folder files in server with default files in vanilla 2.2, but I still get this error, so I know the discussion controller is there, but something else went wrong....I did install 40 plugins yesterday, so maybe one of the plugins is messing it up...

  • R_JR_J Ex-Fanboy Munich Admin
    edited May 2016

    Just to be sure, upload all Vanilla files again.

    I have about 100 (unused) plugins on my test installation and that doesn't influence anything. In order to debug a behavior like that, you normally have to disable all plugins, revert to the standard theme and then re-activate all plugins (and theme) step by step and test it in between.

    But I think I have seen a similar issue and it is caused by a SEO plugin (but I don't know the name)

  • BINGO!!!!! SEO Companion was the plugin that caused this issue...As soon as I disabled it now it works fine....Disabling SEO Companion even fixed the up vote/down vote counter.....Thank God that I didn't have to try every single plugin or that would have been terrible...

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Just a heads up, if a plugin has not been updated since 2011 and you don't know how or if it can be updated to work with 2.2, it will not work with any versions higher than 2.0

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    @okhawaja - welcome to this community. I'm relatively new too and I want to echo @R_J recommendation not to change the core files. That said, I want to suggest a somewhat out of the box approach to your desire to change the title based on the tags.

    What if instead of changing the title you used the tags to change a new field that you add to the discussion table and leave the title alone? You could selectively decide to hide the title or the additional field depending on the circumstances. Take a look at the following plugins for some good ideas of useful hooks as well as some code: profile extender, prefix discussion, filter discussion, discussion Hashtag.

    Also, if your community has different types of users with different access rights to different content, be mindful of the security difference between categories and tags. Access rules can be set in roles and permissions by categories, not tags.

    Good luck!

Sign In or Register to comment.