2 of 8
2
Extension: MD Markitup custom field type for EE Control Panel - add Markitup to EE!
Posted: 18 June 2008 03:55 AM   [ Ignore ]   [ # 19 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  301
Joined  04-12-2008

Another thing I just spotted by quickly running through the code

$sysfolder = $PREFS->ini('system_folder');

...

<
link rel="stylesheet" type="text/css" href="/'.$sysfolder.'/extensions/markitup/skins/markitup/style.css" />

...

This won’t work on production server with no domain assigned yet and a default subfolder like http://www.example.com/~client. The CSS will be included from www.example.com/ instead of www.example.com/~client/.

I’ve seen this in many extensions, the simple solution to this is not to include the files (js, css or whatever) from the “root /” plus system folder, but to include the site_url before the system folder. That way, the site_url setting in your CP will be taken into account.

$system = $PREFS->core_ini['site_url'].$PREFS->core_ini['system_folder'];

...

<
link rel="stylesheet" type="text/css" href="'.$system.'/extensions/markitup/skins/markitup/style.css" />

...

Just a thought.

 Signature 

Designchuchi | Twitter

URL Field Extension
Required Category Extension
DC FreeForm GeoIP Extension
DC Template Manager

Profile
 
 
Posted: 18 June 2008 08:48 AM   [ Ignore ]   [ # 20 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006
peschehimself - 18 June 2008 03:42 AM

One problem I had though was that the preview of markitup was not showing the text properly e.g. with no formatting, saving the entry into the database was fine and textile plugin displayed everything nicely.

I do note on the Markitup page that the preview doesn’t currently work. You need to specify a preview parser path in each set.js file - and I hadn’t even toyed with that yet. It’s the second line down:

previewParserPath:    '', // path to your Textile parser

I did also recommend just turning off the Preview. Note that I THINK the preview works for XHTML. You may only have to specify the path to the Textile plugin here…I’m not sure. If you experiment and find something out about it, I’d love to hear it.

Also, if anyone knows how to fix making multiple-line lists with one click (like you can in the Textile Editor Helper (that’s a different extension) I’d love to incorporate that - but it may just be a shortcoming of Markitup right now).

ADD: I will fix that System folder path issue, too. I know exactly what you mean. The way most exteensions are written that include files, they wouldn’t even work with a masked control panel. Thanks for pointing it out.

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 18 June 2008 05:49 PM   [ Ignore ]   [ # 21 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2062
Joined  09-16-2004

Awesome, many thanks for this, am testing it out on a new EE-site. Cheers! smile
edit-add: works like a charm, this makes Markdown even easier to use for end users.

One tip: if you want to disable a button (say H1 and H2 are already are taken in your template), the easiest way is to set the display to none in the style.css file inside your set folder.
For example: disabling the preview button…
Change:

.markItUp .preview a {
    background
-image:url(images/preview.png);
}

to

.markItUp .preview a {
    display
: none;
}

This way you don’t have to mess around in the JS file.

 Signature 

Peace, e-man.
stookstudio.com, websites built with care and web standards. LinkedIn profile

Profile
 
 
Posted: 18 June 2008 06:11 PM   [ Ignore ]   [ # 22 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Anyone feel like telling me why I can’t get this to work perhaps wink

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 18 June 2008 07:05 PM   [ Ignore ]   [ # 23 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2062
Joined  09-16-2004

Cried victory too soon I’m afraid.
Markdown won’t render links and images properly.
For example:

[Your text to link here...](http://www.apple.be "Apple website")

renders in HTML as:

<p><a href="a href=" title="http://www.apple.be&quot;>http://www.apple.be</a> &quot;dsadadasdas">Your text to link here...</a></p>

In a non Markitup field set to formatting to Markdown I get the same error, which leads me to believe the Markdown plugin is doing something wrong… I’m baffled, any suggestions?

 Signature 

Peace, e-man.
stookstudio.com, websites built with care and web standards. LinkedIn profile

Profile
 
 
Posted: 18 June 2008 07:30 PM   [ Ignore ]   [ # 24 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006
e-man - 18 June 2008 07:05 PM

Cried victory too soon I’m afraid.

Yes, DON’T cry victory too soon with this one. wink

If you are getting the same error, I would assume it is due to the Markdown plugin itself. As I don’t use Markdown, I can’t speak to this. Any Markdown users know about this?

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 19 June 2008 10:15 AM   [ Ignore ]   [ # 25 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2062
Joined  09-16-2004
mdesign - 18 June 2008 07:30 PM
e-man - 18 June 2008 07:05 PM

Cried victory too soon I’m afraid.

Yes, DON’T cry victory too soon with this one. wink

If you are getting the same error, I would assume it is due to the Markdown plugin itself. As I don’t use Markdown, I can’t speak to this. Any Markdown users know about this?

On a positive note, I tested the Textile version on the same site and that one works flawlessly. I posted a request for help with the Markdown plugin in the plugin forum as well.

 Signature 

Peace, e-man.
stookstudio.com, websites built with care and web standards. LinkedIn profile

Profile
 
 
Posted: 19 June 2008 11:08 AM   [ Ignore ]   [ # 26 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2062
Joined  09-16-2004
mdesign - 18 June 2008 07:30 PM

If you are getting the same error, I would assume it is due to the Markdown plugin itself. As I don’t use Markdown, I can’t speak to this. Any Markdown users know about this?

Disabling Automatically turn URLs and email addresses into links? in CP Home ›  Admin ›  Weblog Administration ›  Weblog Management ›  Edit Weblog solves the Markdown problem. That one is sorted then smile

 Signature 

Peace, e-man.
stookstudio.com, websites built with care and web standards. LinkedIn profile

Profile
 
 
Posted: 19 June 2008 11:22 AM   [ Ignore ]   [ # 27 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

That’s cool - glad that’s solved. I always turn that setting off, so it never would have occurred to me to look at that.

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 08 July 2008 08:12 PM   [ Ignore ]   [ # 28 ]  
Lab Assistant
RankRank
Total Posts:  117
Joined  09-19-2006

For those still having trouble getting this to work - I was having the same problem and realized it was because I’m masking access to the control panel using /admin.php

It’s throwing off the path somehow. Try accessing your CP using the actual system folder like:

http://www.domain.com/system/

Hope that helps someone. If any figures out how to enable the preview please share!

P.S. This is one of the the most useful extensions out there. Great work!!!

Profile
 
 
Posted: 08 July 2008 08:49 PM   [ Ignore ]   [ # 29 ]  
Lab Assistant
RankRank
Total Posts:  117
Joined  09-19-2006

Ok here’s how to set up the preview with markdown (should be similar for textile, others):

I created a file called ‘preview.php’ and placed it in the markitup root folder(system/extesions/markitup/preview.php). I also got a copy of markdown.php, and also put it in the markitup root.

Contents of preview.php:

<?php

include_once "markdown.php";
$my_text = $_POST['data']; //'data' is the default post variable markitup sends the data in.
$my_html = Markdown($my_text);
echo(
$my_html);

?>

Then in your ‘set’ file (system/extesions/markitup/sets/markdown/set.js) in the first few lines of code, add the previewParserPath and previewAutorefresh settings:

mySettings_markdown = {
    previewParserPath
:'~/preview.php',
    
previewAutorefresh: true,
        
onShi ...etc

previewAutorefresh is optional - but its pretty cool.

Feel free to add your stylesheets etc to the preview.php file. Have fun!

Profile
 
 
Posted: 08 July 2008 08:56 PM   [ Ignore ]   [ # 30 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

Wow, nice work on that; thanks for sharing your findings on the preview.

I’m a little surprised at the trouble with the masked CP - I almost always use a masked CP, so I generally try to make sure things work that way. If I ever get time to revisit it, I’ll see what’s up.

Oh, ha, I just reread an earlier post where I mention that I’ll update the System folder issue. This thing DOES have version checking built-in, so you should know when a new version is out if you have that feature enabled.

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 09 July 2008 04:47 PM   [ Ignore ]   [ # 31 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  343
Joined  05-22-2008

Hi there-
I’m very thankful that there are really good programmers in the world like you all. I’m, unfortunately, not one of them. I’ve installed the markitup files with the textile set and in the publish or edit modes the textile markitup shows up in the fields I’ve set them up with…which is great!

But when I go to use it the output I get is not good. what happens is if I type in a header style (h1, for example) it perpetuates throughout the whole posting. paragraph tags never appear and only the first styling shows up (with the exception of inline items like <strong> or <em> - they all show up fine).

Am I doing something wrong to get these effects? I know e-man said that he got textile to work flawlessly, but I’m not having the same luck. Any help would be appreciated!

Josh

 Signature 

Josh Clark
I design at Origen Creatives, Blog at Josh Clark Words and have started to Twitter in Haiku.

Profile
 
 
Posted: 09 July 2008 05:04 PM   [ Ignore ]   [ # 32 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2124
Joined  03-26-2006

You have a the field formatting on your custom field set to textile? That is, after having installed the textile plugin, which is entirely different than the textile set for Markitup.

You installed the “tweaked” Textile plugin that I included with the extension files?

Wait a sec - you use textile much? Are you sure you have an empty line after your h1?! And between your paragraphs?

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 09 July 2008 05:31 PM   [ Ignore ]   [ # 33 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  343
Joined  05-22-2008

I guess I’m not up with Textile…I pu in the empty lines and everything works great! Thanks!

Josh

 Signature 

Josh Clark
I design at Origen Creatives, Blog at Josh Clark Words and have started to Twitter in Haiku.

Profile
 
 
Posted: 11 July 2008 01:30 AM   [ Ignore ]   [ # 34 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  659
Joined  04-23-2006

I tried to follow the instructions by bcartier to get preview for Textile, but nothing works.
Anyone get it to show?!

 Signature 

OLD username was jammo, NEW username is OrganizedFellow

It’s a struggle even to keep focused. This is the best of my AD/HD & GTD.
The exceptionally slow growth of my web dev projects is eclipsed by my patience, understanding and desire to learn AS MUCH AS POSSIBLE as I slowly progress.

Profile
 
 
Posted: 18 July 2008 11:58 AM   [ Ignore ]   [ # 35 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  343
Joined  05-22-2008

I’m trying to get this extension to work on a production server within a folder root. I’ve been successful in getting it to run on a normal live site (www.livinghopeineugene.com), but this site - with the same installation procedures it just doesn’t work.

I’m more of a designer than a developer, but I believe that what I’ve read above suggests that there are problems when attempting to install on a production server within a folder. Does anyone have any advice on how to get this up and running in such a scenario…or am I even barking up the right tree?


Josh

 Signature 

Josh Clark
I design at Origen Creatives, Blog at Josh Clark Words and have started to Twitter in Haiku.

Profile
 
 
Posted: 23 July 2008 12:08 AM   [ Ignore ]   [ # 36 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  659
Joined  04-23-2006

I have been really liking using Textile for quick post entries. It makes it just SO much simpler.

Okay, I found that when entering links like so renders just fine:

http://somesite.com

But the following causes a small error:

"Link Text":http://somesite.com

What I mean is, for instance, on other parts of my site (and also one of my favorites, Boyink!), links would render as:
http://www.boyink.com/splaat?URL=http://somesite.com
-OR-
http://organizedfellow.com/?URL=http://somesite.com

Mine do too, except when parsed like:

"Link Text":http://somesite.com

http://somesite.com renders as http://somesite.com and not http://organizedfellow.com/?URL=http://somesite.com

know whatta mean?
smile

 Signature 

OLD username was jammo, NEW username is OrganizedFellow

It’s a struggle even to keep focused. This is the best of my AD/HD & GTD.
The exceptionally slow growth of my web dev projects is eclipsed by my patience, understanding and desire to learn AS MUCH AS POSSIBLE as I slowly progress.

Profile
 
 
   
2 of 8
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120594 Total Logged-in Users: 73
Total Topics: 126631 Total Anonymous Users: 43
Total Replies: 665677 Total Guests: 401
Total Posts: 792308    
Members ( View Memberlist )