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?

Re: Featured Image?

Anyone? Would have thought this would be a fairly simple mod for some of the clever people on here!

Re: Featured Image?

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).

Best regards,
CN Support team

Re: Featured Image?

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?

5 (edited by 2012-11-12 13:28:55)

Re: Featured Image?

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?

Re: Featured Image?

If you managed to get this working could you let me know what you did would love to have a feature like this https://cutephp.com/forum/style_emoticons/default/smile.gif

Re: Featured Image?

If you managed to get this working could you let me know what you did would love to have a feature like this https://cutephp.com/forum/style_emoticons/default/smile.gif

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.

Posts: 7

Pages 1

You must login or register to post a reply