Adding tags to images in Wordpress - image

How can I add support for adding tags to images the same way you can add tags to posts in Wordpress?
I know I can do this by installing a plugin such as the Shiba media library plugin, but that adds a whole lot more than I need. I just need to be able to add tags, no more.

see this tutorial http://code.tutsplus.com/articles/applying-categories-tags-and-custom-taxonomies-to-media-attachments--wp-32319 that explains it all very well.
To use the same tags as your posts you'll just need to add those lines to your functions.php file:
function wptp_add_tags_to_attachments() {
register_taxonomy_for_object_type( 'post_tag', 'attachment' );
}
add_action( 'init' , 'wptp_add_tags_to_attachments' );
After adding those, the tags box will start showing up on your media library items.
The article also describes how to create custom taxonomy (a separate set of tags / categories) but that's probably not required for what you're after.

You can use this plugin to add media tags :
http://wordpress.org/extend/plugins/wordpress-media-tags/
Or you can dig this solution :
https://wordpress.stackexchange.com/questions/29858/adding-category-tag-taxonomy-support-to-images-media

I found an easy solution.
Download the Shiba Media Library plugin at:
http://shibashake.com/wordpress-theme/media-library-plus-plugin
Install it.
Download the Admin Menu Editor plugin at:
http://wordpress.org/extend/plugins/admin-menu-editor/
install it.
With the Admin Menu Editor, hide the gallery menu item (added by the Shiba plugin).
Now I can tag images via the ordinary media library :)

Related

How do I add or remove plugins in CKEditor without rebuilding?

I've just started using CKEditor 4 (having previously used version 1 a long time ago). I like that I can build it online and download it, but when I do that, I then use the toolbar config tool to set up my toolbar.
What happens if I want to add or remove a specific plugin in future though? Will I have to build a completely new CKEditor using the build tool, then download it to replace the existing one, and then reconfigure my toolbar? I don't really want to have to reconfig the toolbar each time.
There are a couple of plugins that I might want to use later, so I'm just trying to figure out whether I need to include them now, or can I add them in with no hassle later on?
Remove plugin
Removing is quite easy. CKEditor provide configuration option where you can define plugins to be remove. https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.config-cfg-removePlugins
E.g.
CKEDITOR.replace( 'editor', {
removePlugins: 'basicstyles,justify'
} );
You need to remember that, removing plugins might break dependancies. E.g. you wish to remove clipboard plugin, but you want to load pastefromword plugin. Paste from Word requires clipboard for proper work, removing clipboard will break loading this plugin. Adequate error will be thrown in the console.
Plugin option
Alternative solution is to define plugins which you wish to load in editor. You need to use plugin option in configuration https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.config-cfg-plugins. This will only load defined plugins together with its dependancies. E.g. In case like above, when you define pastefromword plugin to be loaded, this will also load clipboard plugin.
Adding plugin
There is configuration option for loading extra plugins. Where you can define names of plugins to be loaded: https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.config-cfg-extraPlugins. Here situation is a little bit more complicated because plugin needs to be available for the editor. When you wish to load plugin you need to make 2 things:
Load plugin (more detail description is below)
Add plugin for editor instance, with extraPlugins configuration option.
There might be situation that you have few editors on one page and every of editor will have different available plugins. In such case all plugins will be loaded, but no all will be used in specific editor instance.
Define plugin inline in code
If you wrote your own plugin you might want to define it directly in JS. You just need to take care to be defined before initialisation of the editor.
https://codepen.io/msamsel/pen/NwGJYL
CKEDITOR.plugins.add( 'testplugin', {
init: function( editor ) {
console.log( 'plugin loaded' );
// adding more logic
}
} )
CKEDITOR.replace( 'editor', {
extraPlugins: 'testplugin'
} );
Load plugin from local resources
If you wish to load plugin which you download/create separately, you can create proper folder structure together with CKEditor. Such added plugins will be available and possible to add through extraPlugins.
ckeditor root/
plugins/
<plugin name>/
icons/
<plugin name>.png
dialogs/
<dialog file>.js
plugin.js
A little bit more you can find at the beginning of tutorial for creating plugins: https://docs.ckeditor.com/ckeditor4/docs/#!/guide/plugin_sdk_sample_1
Load plugin from external resources
Plugin might be also loaded form external sources through this method https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.resourceManager-method-addExternal
E.g.
CKEDITOR.plugins.addExternal( 'timestamp', 'https://sdk.ckeditor.com/samples/assets/plugins/timestamp/', 'plugin.js' );
CKEDITOR.replace( 'editor1', {
extraPlugins: 'timestamp'
} );

Wordpress, Genesis theme, streamline pro, How to add an extra .PHP file?

I would like to create a new formhandler.php file where I can collect the info from a form on a page in the streamline pro theme on the genesis framework. I am looking at appearance-> editor -> streamline pro theme. I see a list of php files:
Templates
front-page.php
Theme functions (function.php)
theme-defaults.php (lib/theme-defaults.php)
Landing page templates (page_landing.php)
Now my question is: How do I add another .php file under this? (or anywhere else) to gather the form info using the PHP POST Method. Other suggestions are welcome. Should I do this by building a custom plugin?
You put files in your Child theme, how to add new template, take a look here https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/#Custom_Page_Template, and here also
http://www.carriedils.com/custom-page-template-genesis/

How to use hooks in CS-Cart for overriding footer.tpl file

I am new to cs-cart and
I am trying to use hooks in cs-cart. I had gone through some cs-cart website but not getting proper answer. Suppose if i want to override footer.tpl file with new content then how can i do it using hooks. Just tell me the steps what code to write in index.tpl file and where to keep new footer.tpl file.
I'd suggest you to check this brief guide: http://docs.cs-cart.com/hooks.
Assuming you're on a version 4.x.x:
You don't need to edit anything in index.tpl, just take note of the name of the hook you want to use (I suppose you want to use this one {hook name="index:footer"})
Write your new template and give it the name footer.[override/pre/post].tpl
Save this new .tpl file in themes/[your_theme_name]/templates/addons/my_changes/hooks/index (maybe you need to create such directories in your folders tree)
Make sure you have the "my changes" addon installed and active. You can check it through your admin area of the store.
And that's it, it should work.
Notes:
I've seen no standard "footer.tpl" file in version 4.x.x., so the above instructions work, but they only append content at the end of the page. Customization of such page area can be done via the layout and theme editor on the admin area of the store.
The naming algorithm mentioned on the documentation of cs-cart is for
version 3.x.x. Since version 4.x.x. the folders names have varied.
You should replace skins/[skin name]/[admin|customer] for
design/themes/[your_theme_name]/templates

JOOMLA, Best way to make alternate layouts for articles?

I can't find a answer for this, I want to know what is the best way to have an alternative layouts for articles in Joomla.
If I understand you correctly you are looking for a way to create additional Alternative Layouts for articles. Under parameter tab "Article Options":
If that is the case, its very close to the other provided answers here. Its just that you got to rename the copied default.php file to something else. If you rename it to custom.php it will end up with the text "custom" like the image above.
Here goes my shot for a step by step:
Find the default layout file(s). You could use the ones provided by the com_content component. They can be found at components/com_content/views/article/tmpl. Copy both default.php and default_links.php.
Now you need to rename and copy the file(s) into a template. The target template can be any of the installed templates. Using beez_20 the new path for the copied file(s) should be templates/beez_20/html/com_content/article/custom.php and templates/beez_20/html/com_content/article/custom_links.php.
Goto to edit article using the backend. Expand the Article Options tab and find Alternative Layout. Select your new layout.
Your template might already provide a article override. If so, you might want to use the files of that template instead (instead of the ones in step 1). So if you are using beez_20, you could copy templates/beez_20/html/com_content/article/default.php and templates/beez_20/html/com_content/article/default_links.php.
Helpful links:
Using Joomla’s Template and Layout Override
Layout overrides in Joomla 1.6
The best way to do this would either to install another content component - such as k2 which is highly customizable. Or any other content component on JED.
Alternatively you could create a template override on the existing Joomla Template. This is preferable to editing the files directly in com_content component as the template overrides will never be overwritten whereas the core files will be in any Joomla Updates. I should add, hopefully unnecessarily that this requires Joomla 1.5, 1.6, 1.7, 2.5 or 3.0 (although this is still in beta as of present). So make sure you're not using 1.0.
To create an alternative layout for the built in articles component the best way to do it is probably to create a template over-ride.
See this article on docs.joomla.org on "How to override the output from the Joomla! core"
Creating an alternative for an article layout is pretty straight forward. You can achieve this by using the core layout override with your published template(s).
First you want to get/copy the core article layout file:
components/com_content/views/article/tmpl/default.php
Then place it into your published template:
templates/YOURTEMPLATE/html/com_content/article/default.php
If the template you are using doesn't have the html folder, then you will have to create that folder and each folder to make that path correct.
Once you have this in place, all you need to do is make changes to that default.php file you have just place in the template and that is it!

Adding a "Big Icon" to the Joomla admin dashboard

I've done this befor but with all my memory, search efforts and logic failing I can't figure out how to add a new "Big Icon" link on the main dashboard of the Joomla administration.
What file am i looking to change?
I'm sitting on a fresh install of 1.5.15
Do you mean addin a new "big Icon" to the control panel of the Joomla administration dashboard?
image-example: http://i49.tinypic.com/9ampmq.png
(image is in spanish, just an example)
Anyway, if that is what you're looking for:
Check the mod_quickicon folder inside of /administrator/modules/.
Inside, you should see mod_quickicon.php, open it.
Scroll down and you'll find a <div id="cpanel">...</div>
Here's where you make the magic happen. Just copy one of the quick-icons, i.e.
$link = 'index.php?option=com_media';
quickiconButton( $link, 'icon-48-media.png', JText::_( 'Media Manager' ) );
.. and edit it according to what you need/want. I guess you know what I mean, but just to make sure, you probably want to change the image, the $link (for that you'll have to create a custom folder if you wanna keep it clean, such as "com_whateveryouwant".
I hope this helps.
You could also just download this extension.. but it'll be boring:
--sorry can't post more links, if you're interested, write me back--
Chris.
The best way is to make new Quickicon plugin. The simpliest way is to inspire in Extensionupdate or Joomlaupdate Quickicon plugin.
Copy the directory of some plugin, rename the directory to your own Quickicon Plugin name, edit the file in what you want ... the base thing is that the plugin must return Icon Definition array
Need to add to SQL DB do #_extensions (# is db prefix) new line of code defining that the plg_guickicon_ownplugin is there (again, inspire in Joomlaupdate/Extensionupdate plugin SQL record)
And that's all, no hacking needed, just make own plugin for Quickicon module
The file is a module, you can create a module and assign it to the position of 'icons'.

Resources