Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

October 24, 2020, 08:44:34 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 191351
  • Total Topics: 20907
  • Online Today: 90
  • Online Ever: 1000
  • (October 07, 2020, 04:15:10 PM)
Users Online
Users: 0
Guests: 79
Total: 79

Author Topic: Articles styling  (Read 1291 times)

0 Members and 1 Guest are viewing this topic.

Offline minormike

  • Jr. Member
  • **
  • Posts: 5
Articles styling
« on: October 18, 2020, 08:00:05 AM »
Link to my forum: https://forum dot mmoc dot org dot uk
SMF version: 2.0.17
TP version: 2.0.0
Default Forum Language: English
Theme name and version: Default
Browser Name and Version: Chrome
Mods installed: various
Related Error messages: N/A

I'm a bit lost with how to stylise my articles under TinyPortal other than with the very limited options available in the wysiwyg html editor or the even more limited bb codes. I'd like to style my articles outside of TinyPortal and import the content either with inline css or referencing an external stylesheet, but I can't figure how I might do that. Am I having a blonde moment, or can this be done?

Offline tino

  • Developer
  • *
  • Posts: 2090
Re: Articles styling
« Reply #1 on: October 18, 2020, 09:19:12 AM »
It can be done in multiple ways, you can use raw html in the html editor if you change it to view source.

Or you can reference an external php file.

https://www.tinyportal.net/docs/index.php?page=Creating-an-article

Is a good reference of what you can do.


Offline lurkalot

  • Administrator
  • *
  • Posts: 7042
    • Camera Craniums
Re: Articles styling
« Reply #2 on: October 18, 2020, 09:25:41 AM »
Link to my forum: https://forum dot mmoc dot org dot uk
SMF version: 2.0.17
TP version: 2.0.0
Default Forum Language: English
Theme name and version: Default
Browser Name and Version: Chrome
Mods installed: various
Related Error messages: N/A

I'm a bit lost with how to stylise my articles under TinyPortal other than with the very limited options available in the wysiwyg html editor or the even more limited bb codes. I'd like to style my articles outside of TinyPortal and import the content either with inline css or referencing an external stylesheet, but I can't figure how I might do that. Am I having a blonde moment, or can this be done?

Hi Mike.

You can do either, as long as the ccs styling doesn't clash with the css used to control the rest of the site.  I would advise you to turn off the wysiwyg editor though so it doesn't mess with your custom code in the article.

TinyPortal Admin, click the settings icon with the pen on it.  Uncheck the box next to, Use the WYSIWYG editor, and then save.  This will enable you to add you html code as you like.

Offline minormike

  • Jr. Member
  • **
  • Posts: 5
Re: Articles styling
« Reply #3 on: October 19, 2020, 04:07:59 AM »
That's brilliant - I can put all my styles in a css file on the root of the forum and just call it from inside the articles as required. Thanks again

Offline @rjen

  • Support Team
  • *
  • Posts: 2602
    • FJR-club Nederland
Re: Articles styling
« Reply #4 on: October 19, 2020, 05:02:42 AM »
That's brilliant - I can put all my styles in a css file on the root of the forum and just call it from inside the articles as required. Thanks again

There is a special css file for that you can add the styles to : tp-custom.css
Running TP2.0.0 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 (latest Github)
Want to check what php version I am testing on? See: PHP Info