We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Extension: MD Markitup custom field type for EE Control Panel - add Markitup to EE!

Development and Programming

timkelty's avatar
timkelty
177 posts
16 years ago
timkelty's avatar timkelty

Huh, weird issue I found I’m having…

Markitup/Textile fields are working fine running locally (MAMP) on my machine, but when I deploy to a remote server, my h1-h6 icons get messed up. (see screenshot)

I investigated, and the stylesheet from the default markitup is just overriding my textile set, its getting inserted in the head after my textile set….but only on the server, not locally….spooky. Same repo, same DB.

Local source, textile styles at the end, works as it should:

<!-- Skins -->
<link rel="stylesheet" type="text/css" href="/sys/extensions/markitup/skins/markitup/style.css" />

<!-- Sets -->
<link rel="stylesheet" type="text/css" href="/sys/extensions/markitup/sets/default/style.css" />

<link rel="stylesheet" type="text/css" href="/sys/extensions/markitup/sets/textile/style.css" />

Deployed to server source (default at the end, breaking the styles!):

<!-- Skins -->
<link rel="stylesheet" type="text/css" href="/sys/extensions/markitup/skins/markitup/style.css" />

<!-- Sets -->
<link rel="stylesheet" type="text/css" href="/sys/extensions/markitup/sets/textile/style.css" />

<link rel="stylesheet" type="text/css" href="/sys/extensions/markitup/sets/default/style.css" />

Any idea?

       
e-man's avatar
e-man
1,816 posts
16 years ago
e-man's avatar e-man

I had the same thing just yesterday and just ended up editing the default stylesheet.

/* -------------------------------------------------------------------
// markItUp!
// By Jay Salvat - http://markitup.jaysalvat.com/
// ------------------------------------------------------------------*/
.markItUp .markItUpButton1 a {
    background-image:url(../markdown/images/h1.png); 
}
.markItUp .markItUpButton2 a {
    background-image:url(../markdown/images/h2.png); 
}
.markItUp .markItUpButton3 a {
    background-image:url(../markdown/images/h3.png); 
}
.markItUp .markItUpButton4 a {
    background-image:url(../markdown/images/h4.png); 
}
.markItUp .markItUpButton5 a {
    background-image:url(../markdown/images/h5.png); 
}
.markItUp .markItUpButton6 a {
    background-image:url(../markdown/images/h6.png); 
}

(I use the Markdown set) I’m sure this is a minor bug that will be fixed soon.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

I don’t know why those would be flipped - that doesn’t seem to make any sense. Not sure where to go here without more info 😊

       
timkelty's avatar
timkelty
177 posts
16 years ago
timkelty's avatar timkelty

I know…I’m baffled, but I’ll look into it more.

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

Thanks a ton for making this extension. I installed it last night and it works in that I can edit my text with markdown, but when I save it, or hit the preview button, it isn’t previewing as markdown. E.g #### My Header prints out as #### My Header, not

My Header

. I even wrapped the template variable with {exp:markdown}{bio_body}{/exp:markdown} thinking it would format properly, but it isn’t. I’m not getting any PHP or JS errors either.

Any ideas?

Thanks

       
Brent Cartier's avatar
Brent Cartier
87 posts
16 years ago
Brent Cartier's avatar Brent Cartier

hi tilzinger,

Did you make sure that markdown was set as the format when you created the field? You create a ‘Markitup’ field type but I think you also need to set the format (others are “None”, “Auto BR”, and “XHTML”. Then in the template, you don’t need to wrap the field in the markdown tags.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

@tilzinger: bcartier is right, you need to install the markdown plugin and set the field type to Markdown. You shouldn’t have to wrap anything on the templates.

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

Well, that is the thing, it is set to Markdown in the Text Formatting list.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

Many hours and about 700 lines of PHP later, I think I have Markitup 1.5.0 ready to go. There are a number of enhancements:

  • Can more easily handle multiple instances of different types on a single page (@timkelty, I think this might probably solve your problem above, with the default styles breaking things). This also means you can just comment out lines in one CSS file and they won’t affect the CSS for the other Markitup field types (initially, they all use the exact same classes…which led to problems)
  • System Folder path issue has been fixed
  • Added integration with LG Addon Updater (see pic)
  • Improved the settings page, adding the “skin” setting (see pic)
  • Cleaned up the code, using less hooks to do the work
  • Tested with Playa extension and they both work fine
  • MSM compatible - you can enable this extension on a site-by-site basis

A lot of work went into this thing, and I’m considering making this my first “commercial” add-on, albeit a very reasonable one. I think I need to do some more testing on it first. If this does go commercial, I will probably seriously look at a way to get the preview working for all field types - and listen to and work on suggestions for any improvemnets in a timely manner.

This revised version is definitely something I’d feel more comfortable using in a production environment (I don’t use the current version on any live sites).

But let me know if there is any interest in this - or, if everyone is cool with the previous version, carry on!

Huge props to Leevi Graham and his addon writing brilliance. I had damn near every one of his extensions open as reference when updating my code on this.

       
angstmann's avatar
angstmann
225 posts
16 years ago
angstmann's avatar angstmann

Brilliant Ryan, many thanks for this. I will be trying this out on the current client site I am working on.. I like to live dangerously 😊 I’ll let you know how it goes.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

Has anyone figured out how to tweak Markitup to properly do multiline lists like the Textile Editor Helper extension does? You can’t grab multiple lines with Markitup and make list items all at once - you have to go line by line.

I haven’t released 1.5.0 yet because I’m still testing (and squashing bugs). As I said above - it may have to be commercial due to the amount of work that went into it. 1.5.0 is MUCH tighter than the version that’s out there now.

       
angstmann's avatar
angstmann
225 posts
16 years ago
angstmann's avatar angstmann

I’d very much like to know this as well Ryan, as doing it one by one is a bit of a chore. I have chosen Markdown as my weapon of choice, but I might just try Textile to see if this gives a better client experience. As yet, the client has no experience of either, so I am looking into which will work best for them. Bulleted lists are going to be a big part of their content, so I’d like it to be as easy as possible.

Good luck with getting 1.5.0 out of the door - looking forward to it.

       
angstmann's avatar
angstmann
225 posts
16 years ago
angstmann's avatar angstmann
I had the same thing just yesterday and just ended up editing the default stylesheet.
/* -------------------------------------------------------------------
// markItUp!
// By Jay Salvat - http://markitup.jaysalvat.com/
// ------------------------------------------------------------------*/
.markItUp .markItUpButton1 a {
    background-image:url(../markdown/images/h1.png); 
}
.markItUp .markItUpButton2 a {
    background-image:url(../markdown/images/h2.png); 
}
.markItUp .markItUpButton3 a {
    background-image:url(../markdown/images/h3.png); 
}
.markItUp .markItUpButton4 a {
    background-image:url(../markdown/images/h4.png); 
}
.markItUp .markItUpButton5 a {
    background-image:url(../markdown/images/h5.png); 
}
.markItUp .markItUpButton6 a {
    background-image:url(../markdown/images/h6.png); 
}
(I use the Markdown set) I’m sure this is a minor bug that will be fixed soon.

Hi,

I have exactly the same problem. Tried editing the CSS like you recommended but the problem persists. Any other ideas?

UPDATE: I have the same problem using Textile as well as Markdown, the first six icons are incorrect.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

Guys, there is a major problem when using more than one type of Markitup field on the same page - because they all reference the same stylesheet and styles. So if you hide h1-h5 for textile, and you have another markitup field for XHTML or markdown - the h1-h5 will probably be hidden for those as well. Basically, even if you aren’t hiding anything, the last stylesheet in the code generated by Markitup will be the CSS that is used! That is most likely why your buttons aren’t jiving and giving incorrect output.

This has been addressed in 1.5.0 which is currently in Beta testing because I’m ironing out some more bugs with some other Extensions.

I’m going to be doing some tweaks to 1.5.0 this morning, so if I can come up with a solution for the 1.1.0 version, I’ll post something. Thanks for your patience.

       
Mark Drzycimski's avatar
Mark Drzycimski
19 posts
16 years ago
Mark Drzycimski's avatar Mark Drzycimski

I’m having an odd problem with the extension. If this isn’t the proper venue to discuss this, please point me in the right direction.

I’ve created a custom Markitup field, and changed the field type to “textile”. Any existing entry that uses that custom field now works correctly, but new entries are not using textile formatting. Looking through the DB, I notice that the field type for the Markitup field on the new entries is set to NULL instead of “textile”. Is this a known problem?

Also, could I get a status update on 1.5+? I’m going to be rolling out a new site soon, and for the client’s sake I’d like to keep the control panel as bug-free as possible.

Thanks for this great extension!

       
First 2 3 4 5 6 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.