130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Magazi
- SanderKromwijk
- Joomla! Intern
- Posts: 68
- Joined: Thu Dec 13, 2007 2:59 pm
130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Magazi
Hi,
I'm the one who did task number 127
Sander Kromwijk
I'm the one who did task number 127
Sander Kromwijk
Last edited by AmyStephen on Thu Jan 03, 2008 1:34 am, edited 1 time in total.
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details
- jlleblanc
- Joomla! Guru
- Posts: 963
- Joined: Fri Aug 19, 2005 12:37 am
- Location: Washington, DC / NoVA
- Contact:
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Excellent! Looking forward to more of your code
Joseph L. LeBlanc: http://www.jlleblanc.com
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php
- SanderKromwijk
- Joomla! Intern
- Posts: 68
- Joined: Thu Dec 13, 2007 2:59 pm
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Hi,
Here is my first version.
To use it, you have to put {images} at the beginning. Then put an image on each line (with the image button). At the end, put a {/images}
Sander Kromwijk
Here is my first version.
To use it, you have to put {images} at the beginning. Then put an image on each line (with the image button). At the end, put a {/images}
Sander Kromwijk
You do not have the required permissions to view the files attached to this post.
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details
- SanderKromwijk
- Joomla! Intern
- Posts: 68
- Joined: Thu Dec 13, 2007 2:59 pm
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Hi,
Here is my final version (unless there are big problems)
Sander Kromwijk
Here is my final version (unless there are big problems)
Sander Kromwijk
You do not have the required permissions to view the files attached to this post.
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details
- mcsmom
- Joomla! Exemplar
- Posts: 7897
- Joined: Thu Aug 18, 2005 8:43 pm
- Location: New York
- Contact:
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Sander,
Could you put the instructions for use of the plugin into the description? I love the detailed instructions, maybe there is a way to install that on the site somehow?
When I first used the plugin I got some warning messages. However, I figured out what the problem was.
Th plugin was expecting the images to be includes n ... once i did that it worked. However this wasn't clear from the documentation. I think you should try to modify the program to allow for additonal delimiters, specifically and since both are commonly inserted by wysiwyg editors.
Install and uninstall went great, and the reults are great to look at.
Could you put the instructions for use of the plugin into the description? I love the detailed instructions, maybe there is a way to install that on the site somehow?
When I first used the plugin I got some warning messages. However, I figured out what the problem was.
Th plugin was expecting the images to be includes n ... once i did that it worked. However this wasn't clear from the documentation. I think you should try to modify the program to allow for additonal delimiters, specifically and since both are commonly inserted by wysiwyg editors.
Install and uninstall went great, and the reults are great to look at.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.
-
- Joomla! Champion
- Posts: 7018
- Joined: Wed Nov 22, 2006 3:35 pm
- Location: Nebraska
- Contact:
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Sander -
Very, very nice!
Pull those style tags out and place them into a file - then include the file within your php file.
These two files can be copied into a folder named magazinelayout:
Usually, if it's just the php, xml, css and 1 js file, they can all stay in the root of the content plugins - but if there is more than that, creating a folder can be helpful. You could add your css to that folder, if you choose.
This is a beauty - there is no doubt. What a great way to take a set of up to eight images and turn it into a perfectly arranged gallery. This has the potential of dressing up many J! sites.
I love how you allow the image manager to be used. You need to consider, though, that a lot of HTML is going to slip in there between the images. When that happens, the site bombs hard.
When we used a NoWYSIWYG editor - it only recognized the first image - experimenting more, it appeared that paragraph tags around the images created a perfect feed to your program.
Give it some thought how you can handle the inexperienced user with the editor - and the noWYSIWYG editor. At bare minimum, make it perfectly obvious in the instructions what that HTML should look like inside of the plugin.
This is a wonderful, wonderful, wonderful plugin. People are going to love it. Thanks for taking the task. We'll look for your next post!
Amy
Very, very nice!
Pull those style tags out and place them into a file - then include the file within your php file.
Code: Select all
// Add CSS
$document =& JFactory::getDocument();
$document->addStyleSheet( JURI::base() . 'plugins/content/slimbox.css', 'text/css', null, array( ' id' => 'StyleSheet' ) );
Code: Select all
<filename plugin="magazinelayout">magazinelayout.image.php</filename>
<filename plugin="magazinelayout">magazinelayout.class.php</filename>
This is a beauty - there is no doubt. What a great way to take a set of up to eight images and turn it into a perfectly arranged gallery. This has the potential of dressing up many J! sites.
I love how you allow the image manager to be used. You need to consider, though, that a lot of HTML is going to slip in there between the images. When that happens, the site bombs hard.
When we used a NoWYSIWYG editor - it only recognized the first image - experimenting more, it appeared that paragraph tags around the images created a perfect feed to your program.
Give it some thought how you can handle the inexperienced user with the editor - and the noWYSIWYG editor. At bare minimum, make it perfectly obvious in the instructions what that HTML should look like inside of the plugin.
This is a wonderful, wonderful, wonderful plugin. People are going to love it. Thanks for taking the task. We'll look for your next post!
Amy
- SanderKromwijk
- Joomla! Intern
- Posts: 68
- Joined: Thu Dec 13, 2007 2:59 pm
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Hi,
Here is the plugin. I saw that I had made a mistake with the pargraph thing. It is not necessery to put any delimiters anymore, only the two {images} tags. I can't test the plugin because I'm not on my own computer (I'm on vacation), so I hope I did not make any coding errors. I've also written a part in the documentation for the people who don't use wysiwyg editors. The two php files and the css file are in another directory.
Sander Kromwijk
Here is the plugin. I saw that I had made a mistake with the pargraph thing. It is not necessery to put any delimiters anymore, only the two {images} tags. I can't test the plugin because I'm not on my own computer (I'm on vacation), so I hope I did not make any coding errors. I've also written a part in the documentation for the people who don't use wysiwyg editors. The two php files and the css file are in another directory.
Sander Kromwijk
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details
- SanderKromwijk
- Joomla! Intern
- Posts: 68
- Joined: Thu Dec 13, 2007 2:59 pm
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Hi,
I forgot to attach the file, here it is:
Sander Kromwijk
I forgot to attach the file, here it is:
Sander Kromwijk
You do not have the required permissions to view the files attached to this post.
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details
- mcsmom
- Joomla! Exemplar
- Posts: 7897
- Joined: Thu Aug 18, 2005 8:43 pm
- Location: New York
- Contact:
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Sander,
I uninstalled and tried to reinstall ... I got this error:
* JInstaller::install: File '/home/xxxx/public_html/rc4/tmp/install_476f9ffeb932b/plg_magazinelayout/magazinelayout.image.php' does not exist
Message
I uninstalled and tried to reinstall ... I got this error:
* JInstaller::install: File '/home/xxxx/public_html/rc4/tmp/install_476f9ffeb932b/plg_magazinelayout/magazinelayout.image.php' does not exist
Message
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.
-
- Joomla! Champion
- Posts: 7018
- Joined: Wed Nov 22, 2006 3:35 pm
- Location: Nebraska
- Contact:
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
I had the same problem as mcsmom.
Try this for your xml file:
Try this for your xml file:
Content - Magazine Layout
Sander Kromwijk
December 2007
Sander Kromwijk. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
[email protected]
1.0
Plugin which implements a Magazine Layout
magazinelayout.php
MagazineLayout
en-GB.plg_content_magazinelayout.ini
- SanderKromwijk
- Joomla! Intern
- Posts: 68
- Joined: Thu Dec 13, 2007 2:59 pm
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Hi,
I tried to correct the problem, but since the new version RC4 it doesn't work anymore. Did the event names change?
Sander Kromwijk
I tried to correct the problem, but since the new version RC4 it doesn't work anymore. Did the event names change?
Sander Kromwijk
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details
- SanderKromwijk
- Joomla! Intern
- Posts: 68
- Joined: Thu Dec 13, 2007 2:59 pm
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Sorry,
I forgot the / in the ending tag
Sander Kromwijk
I forgot the / in the ending tag
Sander Kromwijk
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details
- SanderKromwijk
- Joomla! Intern
- Posts: 68
- Joined: Thu Dec 13, 2007 2:59 pm
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Hi,
Here is the corrected version. I have been able to test it this time, so now I'm sure it works. Unless something is missing, this is the final version.
Sander Kromwijk
Here is the corrected version. I have been able to test it this time, so now I'm sure it works. Unless something is missing, this is the final version.
Sander Kromwijk
You do not have the required permissions to view the files attached to this post.
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details
- jlleblanc
- Joomla! Guru
- Posts: 963
- Joined: Fri Aug 19, 2005 12:37 am
- Location: Washington, DC / NoVA
- Contact:
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Looks good over all, here are a few comments:
You can get rid of the second loop by using this regex to find all single and double quotes:
Note that the \ inside of the character class is escaping the single quote for the string and not for the regex.
I'm looking for a way around hand editing the images to get the paths right. Here's my solution so far. Before you get to the loop, build the path to strip:
Inside the loop right before you add the match to the array, strip out this path if it exists:
This solution isn't ideal, but it works on my end. The whole str_replace('~', '%7E', $uri->getPath()); bit is my way of escaping the ~ character (which is a part of the URL I'm testing this from). A more robust solution would be to split the result of $uri->getPath() on /, urlencode() the pieces, then join them up again. This will at least fix it for the editor that ships with Joomla! (TinyMCE). It would also be better if I didn't prepend the '../..' bit to the beginning; you can probably write a preg_replace() regex to ignore everything before the urlencoded version of $uri->getPath();
I would definitely implement the first of these two so you don't have to do two separate loops for both kinds of quotes. The second part is trickier, but would definitely improve the usability of the plugin.
You can get rid of the second loop by using this regex to find all single and double quotes:
Code: Select all
$regex = '/src=["\'](.*)["\']/iU';
I'm looking for a way around hand editing the images to get the paths right. Here's my solution so far. Before you get to the loop, build the path to strip:
Code: Select all
$uri =& JFactory::getURI();
$path = '../..' . str_replace('~', '%7E', $uri->getPath());
Code: Select all
if (stristr($matches[1][$i], $path)) {
$matches[1][$i] = str_replace($path, '', $matches[1][$i]);
}
I would definitely implement the first of these two so you don't have to do two separate loops for both kinds of quotes. The second part is trickier, but would definitely improve the usability of the plugin.
Joseph L. LeBlanc: http://www.jlleblanc.com
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php
- SanderKromwijk
- Joomla! Intern
- Posts: 68
- Joined: Thu Dec 13, 2007 2:59 pm
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Hi,
I corrected the things you said. Is it OK now?
Sander Kromwijk
I corrected the things you said. Is it OK now?
Sander Kromwijk
You do not have the required permissions to view the files attached to this post.
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details
- jlleblanc
- Joomla! Guru
- Posts: 963
- Joined: Fri Aug 19, 2005 12:37 am
- Location: Washington, DC / NoVA
- Contact:
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
Yes, it looks great! I'm going to say this is done, but I'll let one of the other judges take a look and give feedback.
Joseph L. LeBlanc: http://www.jlleblanc.com
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php
-
- Joomla! Champion
- Posts: 7018
- Joined: Wed Nov 22, 2006 3:35 pm
- Location: Nebraska
- Contact:
Re: 130 - Create a Joomla! v 1.5 Plugin to implement A List Apart's Automatic Ma
I love this, very, very much and can't wait to start seeing it on some sites. I mean, how easy can things get? WOW!
I also accept this as complete. Please upload to the Google Task Page. When you have done so, we will mark it complete there, as well, and you will be free to choose another task, if you wish.
Thank you for your contributions to the Joomla! community,
Amy
I also accept this as complete. Please upload to the Google Task Page. When you have done so, we will mark it complete there, as well, and you will be free to choose another task, if you wish.
Thank you for your contributions to the Joomla! community,
Amy