beats23 Posted February 9, 2019 Share Posted February 9, 2019 Anyone care to create a plugin or app then sell it in the marketplace, for making the Record Image (field) be able to set as required for separate Pages database? With this plugin, a user will have to upload an image to the Record image field before they can submit a Pages post (similar to the IPS downloads option for screenshot required before a user can submit a file). The benefits are. The admin will not have a bunch of submitted articles with no cover photos. Less work for the admin, more time to play for the admin😀 Link to comment
Meddysong Posted February 10, 2019 Share Posted February 10, 2019 If nobody responds to this, one thing you could do is amend the templates in your database so that {{if $record->record_image}} <div class="cCmsRecord_image"> <img class="ipsImage" src="{file="$record->_record_image_thumb" extension="cms_Records"}"> </div> {{endif}} becomes something like <div class="cCmsRecord_image"> <img class="ipsImage" src="{{if $record->record_image}}{file="$record->_record_image_thumb" extension="cms_Records"}{{else}}[something else]{{endif}}"> </div> All you have to do is provide an address to a fallback image and if your user doesn't provide an image, the post will use the one that you've uploaded. Link to comment
beats23 Posted February 10, 2019 Author Share Posted February 10, 2019 7 hours ago, Meddysong said: If nobody responds to this, one thing you could do is amend the templates in your database so that {{if $record->record_image}} <div class="cCmsRecord_image"> <img class="ipsImage" src="{file="$record->_record_image_thumb" extension="cms_Records"}"> </div> {{endif}} becomes something like <div class="cCmsRecord_image"> <img class="ipsImage" src="{{if $record->record_image}}{file="$record->_record_image_thumb" extension="cms_Records"}{{else}}[something else]{{endif}}"> </div> All you have to do is provide an address to a fallback image and if your user doesn't provide an image, the post will use the one that you've uploaded. Where should I place the fallback URL for the image? Thanks Link to comment
opentype Posted February 10, 2019 Share Posted February 10, 2019 You can upload it through the “media” section of the Pages app and then put the call where it says “something else” above. Link to comment
beats23 Posted February 10, 2019 Author Share Posted February 10, 2019 13 minutes ago, opentype said: You can upload it through the “media” section of the Pages app and then put the call where it says “something else” above. <div class="cCmsRecord_image"> <img class="ipsImage" src="{{if $record->record_image}}{file="$record->_record_image_thumb" extension="cms_Records"}{{else}}[https://www.mysite.com/uploads/site_images/fallbackimage1.jpg]{{endif}}"> </div> Is this the way the image URL should be placed? Thanks Link to comment
beats23 Posted February 10, 2019 Author Share Posted February 10, 2019 I add this code to the record display but it didn't work any thoughts <article class='ipsContained ipsSpacer_top'> <div class='ipsClearfix'> {{if $record->record_image AND !settings.SuperGrid_record_hero}} <div class="cCmsRecord_image ipsPos_right"> <img class="ipsImage ipsPos_right" src="{file="$record->_record_image_thumb" extension="cms_Records"}{{else}}[https://www.mysite.com/uploads/monthly_2019_02/ic44.jpg.acb8bf5ea3b723b7042a2a34a67b0f26.jpg.ca8bc759e76d13c58a17c8eda4a37729.jpg]"> </div> {{endif}} Link to comment
Meddysong Posted February 10, 2019 Share Posted February 10, 2019 18 minutes ago, beats23 said: I add this code to the record display but it didn't work any thoughts <article class='ipsContained ipsSpacer_top'> <div class='ipsClearfix'> {{if $record->record_image AND !settings.SuperGrid_record_hero}} <div class="cCmsRecord_image ipsPos_right"> <img class="ipsImage ipsPos_right" src="{file="$record->_record_image_thumb" extension="cms_Records"}{{else}}[https://www.mysite.com/uploads/monthly_2019_02/ic44.jpg.acb8bf5ea3b723b7042a2a34a67b0f26.jpg.ca8bc759e76d13c58a17c8eda4a37729.jpg]"> </div> {{endif}} The code's wrong. You've kept the [] quotes I put in there to show some text. Chop them out to leave just the address and that should work. Or for neatness, as opentype suggests, upload it to Pages > Media. Then you can replace the address with {media='1'} (or whatever the number is). Link to comment
beats23 Posted February 10, 2019 Author Share Posted February 10, 2019 25 minutes ago, Meddysong said: The code's wrong. You've kept the [] quotes I put in there to show some text. Chop them out to leave just the address and that should work. Or for neatness, as opentype suggests, upload it to Pages > Media. Then you can replace the address with {media='1'} (or whatever the number is). I uploaded the image to the pages media and edit the records display code to the code below but it doesn't work, it only displays the image URL on the post page. Thanks for your help. <article class='ipsContained ipsSpacer_top'> <div class='ipsClearfix'> {{if $record->record_image AND !settings.SuperGrid_record_hero}} <div class="cCmsRecord_image ipsPos_right"> <img class="ipsImage ipsPos_right" src="{file="$record->_record_image_thumb" extension="cms_Records"}{{else}}{media="1"}"> </div> {{endif}} I'm still up for a plugin that can set the record image field as required, I'll pay. Thanks Link to comment
Meddysong Posted February 10, 2019 Share Posted February 10, 2019 I think the reason that it isn't working is that {media="1"} needs to be {media='1'} because the bit surrounding it (src=" ... ") is already using the double quotes. Link to comment
fourday Posted April 28, 2019 Share Posted April 28, 2019 I will also pay for this plugin... or pay someone to make my record image required! Let me know who wants to help! Link to comment
2002faq Posted May 16, 2019 Share Posted May 16, 2019 @Adriano Faria, any chance to expend the functionality to Blogs? thank you, Steve K. Link to comment
beats23 Posted June 19, 2019 Author Share Posted June 19, 2019 On 4/28/2019 at 12:28 PM, Adriano Faria said: Thanks for the plugin but there is one issue. When creating an article for the first time, there is no record image required on the photo tab. When I save that article then edit it, in the edit window, the record image required is shown. Can you alter the plugin so when an article is first created the record image required is shown? Link to comment
Ramsesx Posted June 19, 2019 Share Posted June 19, 2019 35 minutes ago, beats23 said: Can you alter the plugin so when an article is first created the record image required is shown? On my installation it is shown when creating a new record. Just for informational purposes. Link to comment
Adriano Faria Posted June 19, 2019 Share Posted June 19, 2019 37 minutes ago, beats23 said: Can you alter the plugin so when an article is first created the record image required is shown? 3 minutes ago, Ramsesx said: On my installation it is shown when creating a new record. Same here. Works fine for a new record: Link to comment
beats23 Posted June 19, 2019 Author Share Posted June 19, 2019 Thanks seems the issue is with my IPS, I'll investigate Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.