⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

image_crud add get image URL button



Гэрэлт-Од Гоцбаяр

Гэрэлт-Од Гоцбаяр
  • profile picture
  • Member

Posted 29 April 2013 - 13:57 PM

I'm using Grocery_CRUD and Image_CRUD on my backend code. When I'm using Grocery_CRUD with TinyMCE texteditor there isn't any image upload feature. For example if admin want image in middle of text, he can't upload image. So I used Image_CRUD and created new link for it. But now problem is how can Admin get upload Image URL and put it TinyMCE's Image input URL field?

 

 

thanks.


victor

victor
  • profile picture
  • Member

Posted 01 May 2013 - 06:14 AM

Try to look for file-uploader for the TinyMCE. 

there is http://www.moxiemanager.com/ for example.


jrowe

jrowe
  • profile picture
  • Member

Posted 01 May 2013 - 12:39 PM

I have added a custom link to the image crud view where you upload/rearrange/add title to pictures..all it does is add a link to the direct URL of the image..

 

It is located in the list.php file under \assets\image_crud\views

 

	<ul class='photos-crud'>
	<?php foreach($photos as $photo_num => $photo){?>
			<li id="photos_<?php echo $photo->$primary_key; ?>">
				<div class='photo-box'>
					<a href='<?php echo $photo->image_url?>' <?php if (isset($photo->title)) {echo 'title="'.str_replace('"',"&quot;",$photo->title).'" ';}?>target='_blank' class="color-box" rel="color-box" tabindex="-1"><img src='<?php echo $photo->thumbnail_url?>' width='90' height='60' class='basic-image' /></a>
					<?php if($title_field !== null){ ?>
					<textarea class="ic-title-field" data-id="<?php echo $photo->$primary_key; ?>" autocomplete="off" ><?php echo $photo->$title_field; ?></textarea>
					<div class="clear"></div><?php }?>
					<?php if($has_priority_field){?><div class="move-box"></div><?php }?>
					<?php if(!$unset_delete){?><div class='delete-box'>
						<a href='<?php echo $photo->delete_url?>' class='delete-anchor' tabindex="-1"><?php echo $this->l('list_delete');?></a>
					</div><?php }?>
					
<!-- This part I added -->
<div class="clear"></div>
                    <div>

<a href="<?php echo $photo->image_url; ?>"> URL </a>

</div>
<!-- end of part I added -->
					<div class="clear"></div>
				</div>
			</li>
	<?php }?>
		</ul>

The part I added to have a direct link to the image and its direct URL..you could also use $photo->image_url to put in a textbox so they can easilly copy it to be pasted in your textarea