Topic: Featured Image?
Would it be possible to create a field (not using the available option, but by coding it) and having a browse images button to the side of it to choose an image to use as the featured image for each article?
Dear CuteNews Users! Please feel free to contact us via our new Feedback Form and please send information about bugs to our bug tracker.
You are not logged in. Please login or register.
CutePHP Forums → Problem Solving / Help & Support → Featured Image?
Would it be possible to create a field (not using the available option, but by coding it) and having a browse images button to the side of it to choose an image to use as the featured image for each article?
Anyone? Would have thought this would be a fairly simple mod for some of the clever people on here!
In the version 1.5 there is a possibility to write the plug-in and also add your own field through Additional fields or use the field Avatar (it works also for the version 1.4.7).
In the version 1.5 there is a possibility to write the plug-in and also add your own field through Additional fields or use the field Avatar (it works also for the version 1.4.7).
I have added the field. How would I go about creating a plugin to add a button to browse images?
Right, i've managed to get it to work so that on my xfield for featured image there is a Choose Image button that opens the images up and inserts the code perfectly, but i've got an issue.
On the add news page, it shows up like this:
{/if}
Title
# More fields...Image {if $xfields.0=image} Choose Image
Despite the code being like this:
{if $xfields.0=image} [url=#]Choose Image[/url] </td> {/if}
Any ideas?
If you managed to get this working could you let me know what you did would love to have a feature like this
If you managed to get this working could you let me know what you did would love to have a feature like this
I did get it working, but it was a really hacky way of doing things.
I added an xfield for the featured image that I then put in to [img]{featuredimage}[/img]
Then in skins/base_skin/addnews/index_cke.tpl (because of using CKEditor), I added this:
{foreach from=xfields}
<tr>
<td>{$xfields.1}</td>
<td><input tabindex=2 type=text size="42" value="{$xfields.3}" name="{$xfields.0}" id="{$xfields.0}" > <span style="font-size:7pt">{$xfields.2}</span>
<span style="display:none"> {if 0=featuredimage}</span>
[url=#]Choose Image[/url]
</td>
{/if}
</tr>
{/foreach}
I'm not sure if it's right coding, but it works on mine. Basically {if 0=featuredimage} means it checks to see if the xfield is featuredimage and if it does it shoes the choose image link next to the field. Then the "&area=featuredimage" part means when the image is chosen, the url is added to the correct field.
Not perfect and as I say, hacky, but it does the job.
CutePHP Forums → Problem Solving / Help & Support → Featured Image?
Powered by PunBB, supported by Informer Technologies, Inc.
The pun_antispam official extension is installed. Copyright © 2003–2009 PunBB.