Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I've tried Drupal 7 beta which now embeds CCK Image fields, but not found how to setup a image field with link URL...
Comment | File | Size | Author |
---|---|---|---|
#12 | Screen shot 2011-04-12 at 10.38.32 AM.png | 39.68 KB | damiandab |
#5 | linkimagefield.zip | 4.37 KB | skilip |
Comments
Comment #1
drupalku.net CreditAttribution: drupalku.net commented+1
Waiting for D7 port
www.drupalku.net
Comment #2
mattcoady CreditAttribution: mattcoady commentedYes, this needs to happen.
Comment #3
TimG1 CreditAttribution: TimG1 commented+1 Subscribing. Are there plans to make a D7 version?
Comment #4
didox CreditAttribution: didox commentedSubscribing
Comment #5
skilip CreditAttribution: skilip commentedHere's a Drupal 7 port.
Comment #6
vervecreations CreditAttribution: vervecreations commentedSkilip. Are you kidding me!?! I just finished porting this 15 minutes ago as a great "learn drupal 7 module writing" project. It took me three days of debugging and going through the drupal module writing learning curve. I was about to post it and you already did it early this morning! ;)
Nice work on it. It has a few extra options that mine didn't have. Looks like you went about it the same way I did, inheriting from the image field wherever possible. This will be greatly useful in many projects. Great job once again.
Comment #7
skilip CreditAttribution: skilip commented@vervecreations: That is a dipper indeed! We should have joined forces! At least we both have learned a lot about Field API ;).
Comment #8
vervecreations CreditAttribution: vervecreations commentedOh well, the education was indeed worth it regardless :) Thanks for your work on it!
Comment #9
carlos.macao CreditAttribution: carlos.macao commentedI've installed the #5 attachment. But after following the rules of the README file, I can't see any box for inserting the URL, the cck works exactly the same as the image field.
Comment #10
eule CreditAttribution: eule commented#9 same here ... i test it now..it works only after you have uploaded a picture..thats crazy ;)
Comment #11
cwyant CreditAttribution: cwyant commentedSame problem here. Field is added to content type, but it still behaves like the regular image upload field.
Comment #12
damiandab CreditAttribution: damiandab commentedI dont understand you (#9, #10, #11).
Its working as designed (see attachment picture).
Create a new linkimagefield through the Field interface:
Visit Administer ->Structure -> Content types (admin/structure/types), then click
Manage fields on the type you want to add an image upload field.
Select "Link Image" as the field type and "Link Image" as the widget type to create a new field.
@eule > of course you have first to upload image to could link this image ;)
Comment #13
eule CreditAttribution: eule commentedI'm probably understand the module wrong...i look for a img field who i can add a url for an existing image. so thats the user not need to upload a picture. i look for a quick way to let users paste a img url...is there something?
Comment #14
damiandab CreditAttribution: damiandab commentedYes, I think also the module should extend the type "image" and not to create new type "Link image".
It should works something like an option in configuration of image field , example: "Enable External Url field " , the same like for "Enable Alt field" or "Enable Title field".
I think we should create new issue in "feature request" category.
Till know a solution I would use is to create 2 field types: image and link field(http://drupal.org/project/link) and then rewrite node template for the node type you are using for these 2 fields.
You can also use the contemplate module: http://drupal.org/project/contemplate.
If you want to display linked image with views , you can very easy add 2 fields(image and link) , exclude them and then add another node field(title or link) and rewrite the output using replacement patterns, example:
Comment #15
skilip CreditAttribution: skilip commentedThe module attached here is a port of the Drupal 6 version of Image Link. The original module works the same; it adds a 'Link Image' field with which you can create links with images instead of text.
Only adding a widget which can be selected while creating a regular Image field would require the Image field schema to be altered. In that way, all fields of the image type will have an extra database column for the 'url' field. That's not really a good idea IMHO. Creating a separate issue for that is though ;).
Comment #16
damiandab CreditAttribution: damiandab commented@skilip
I meaned to create an extension for image field that add new option "Enable External Url field ", so it could work with another widgets, for example image crop. Of course new database column would be necessary. Why you mean its not a good idea?
Comment #17
crised CreditAttribution: crised commentedHello I am able to do this but... I get a lot of errors:
Notice: Undefined index: url_settings in linkimagefield_widget_process() (line 215 of /home/crised/public_html/modules/linkimagefield/linkimagefield.module).
Notice: Undefined index: url_settings in linkimagefield_widget_process() (line 220 of /home/crised/public_html/modules/linkimagefield/linkimagefield.module).
Notice: Undefined index: url_settings in linkimagefield_widget_process() (line 221 of /home/crised/public_html/modules/linkimagefield/linkimagefield.module).
Notice: Undefined index: url_settings in linkimagefield_widget_process() (line 226 of /home/crised/public_html/modules/linkimagefield/linkimagefield.module).
Notice: Undefined index: url_settings in linkimagefield_widget_process() (line 234 of /home/crised/public_html/modules/linkimagefield/linkimagefield.module).
Notice: Undefined index: insert in insert_element_process() (line 170 of /home/crised/public_html/sites/all/modules/insert/insert.module).
Damiandab, please provide a more detailed explanation of how to link an image with link module. I have already download it, but what is the file pattern?
P.D: How can be possible that something as simple as linking an image can be so difficult?
Comment #18
Mark Nielsen CreditAttribution: Mark Nielsen commentedCrised, are you using the Contemplate module?
I have to say that I don't think using the standard link and image field modules together is perfect, as you couldn't easily create multiple linked images.
Generally, it's not. A WYSIWYG editor is a more common route for this. By going down the route of image fields (especially using link and image fields together), you're choosing to build your own specific implementation. These modules naturally need thinking about a bit more because they're designed to be so flexible and abstracted.
Comment #19
crised CreditAttribution: crised commentedNo I'm not using it. Should I? I will install it.
Comment #20
crised CreditAttribution: crised commentedDear Mark,
Contemplate module did the trick!
but... there is still an error when I edit the page:
Notice: Undefined index: insert in insert_element_process() (line 170 of /home/crised/public_html/sites/all/modules/insert/insert.module).
Comment #21
joostvdl CreditAttribution: joostvdl commentedModule from #5 works very good.
Can one of the maintainers create a 7.x version so working on this module can continue?
Comment #22
AndyZhang CreditAttribution: AndyZhang commentedsubscribing
Comment #23
rowbeast CreditAttribution: rowbeast commentedsubscribing +1
Comment #24
jmix CreditAttribution: jmix commentedHi, the module is working on my D7 install, but there's no way to choose the target for links (_blank, _self etc...).
I see a line of code for that in linkimagefield.module (line 371+), but can't see the option in D7 administration.
I'm very new to Drupal, so totally unable to modify that by myself. Any idea ?
Thanks.
Comment #25
dsdart CreditAttribution: dsdart commentedThanks - just what I needed
Comment #26
plastikkposen CreditAttribution: plastikkposen commented+1
Comment #27
desrosj CreditAttribution: desrosj commentedSubscribe
Comment #28
luckystrikerin CreditAttribution: luckystrikerin commented+1
Comment #29
MrPaulDriver CreditAttribution: MrPaulDriver commentedSubscribe
Comment #30
magohata CreditAttribution: magohata commentedThe Module work for me, but not exacly what i expected
i want to have the option to a externarl URL with the Field Slideshow module
I can not make them work together, because this module has its own method to upload pictures and the external URL as a link fild but I can not select the format SlideShow in the content type from the module Field SlideShow
Comment #31
Anonymous (not verified) CreditAttribution: Anonymous commentedEDIT: #5 works for me. However, I'm getting this error when trying to use a default image:
Notice: Undefined index: url in theme_linkimage_formatter() (line 353 of /home/xxxxxx/public_html/sites/all/modules/linkimagefield/linkimagefield.module).
Comment #32
dopla CreditAttribution: dopla commentedComment #33
sachbearbeiter CreditAttribution: sachbearbeiter commentedsub
Comment #34
jamesbenison CreditAttribution: jamesbenison commentedThis project appears to be abandoned as there has not been any commits made in two years. The maintainers also do not appear to be active members of the community anymore based on their posting history. Yet this project still has over 3000 users.
I'm proposing that for the short term we set up a sandbox for the code that is currently working. That way we can at least have a repo for downloading code and committing patches.
The next logical step would be for somebody to take over as the new maintainer. Seems like skilip or vervecreations would be logical choices for this.
See this page for dealing with abandoned projects: http://drupal.org/node/251466
Comment #35
jnettiksubscribing
Comment #36
jamesbenison CreditAttribution: jamesbenison commentedI have set up a sandbox code repository.
Located here: http://drupal.org/sandbox/jamesbenison/1275344
Comment #37
westside85 CreditAttribution: westside85 commentedWorks for me demo , but still shows an error message after I delete the caches errors disappear.
Comment #38
pfrenssenChanging title.
I am now testing the D7 version in #36 and it seems to be fine. The code seems ok too on first glance.
Comment #39
pfrenssenI am using the D7 version in #36 in production now, it is feature complete and stable.
Comment #40
Jason Dean CreditAttribution: Jason Dean commented#36 working great for me in production sites - thanks!
Comment #41
Anonymous (not verified) CreditAttribution: Anonymous commented-
Comment #42
sondes CreditAttribution: sondes commentedI'm using the code with no problems! Thanks so much!!
Comment #43
stefanp CreditAttribution: stefanp commentedthe attached zip file works perfectly just followed the readme and edit the custom content i had.
Comment #44
pfrenssenUpdating status since there were multiple reports of the port working fine.
Comment #45
jamesbenison CreditAttribution: jamesbenison commentedProblem isn't totally solved. The code hasn't been migrated to an official project and we need a maintainer. I'm already overextended, but I'm always happy to help when I can.
Comment #46
lyle@4fs CreditAttribution: lyle@4fs commentedYou are a genious and a scoller sir . I have been looking for this forever, on my birthday.. shot!!!!
Comment #47
lyle@4fs CreditAttribution: lyle@4fs commentedDamn gave me errors in drupal 7.10 ..
Comment #48
jhrizz CreditAttribution: jhrizz commentedSubscribing... This capability should be in the core, IMHO
Comment #49
DERIIIFranz CreditAttribution: DERIIIFranz commentedI'm using the D7 port and it worked well for me up to now. But now I think I'm facing a bug.
Every image I include on my site using linkimagefield with NO specified url links to my landing page by default! Maybe it's interesting that my site is multilingual using i18n. Here's a test-link to my site where the bug occurs: http://www.freundlinger.net.config06.itandtel.at/de/content/planung
edit: every image of the german versions links to "/de" and to "/en" in my english version..
Comment #50
DERIIIFranz CreditAttribution: DERIIIFranz commentedi solved this problem now by simply changing
to
maybe this should be considered for the next release
Comment #51
pfrenssen@DERIIIFranz, the D7 version of this module is maintained in a sandbox. To make sure the maintainer sees it you might want to create a new issue here: http://drupal.org/project/issues/1275344
When you discover a new bug it is usually a good idea to make a separate issue, that makes it easier to work on and get it fixed.
Comment #52
pfrenssenMarked #951742: Port "Link Image Field" to Drupal7 as a duplicate of this issue.
Comment #53
damiandab CreditAttribution: damiandab commentedI tested both modules: from 'skilip ' and a sanbox project of 'jamesbenison' and I get warning message, when I set unlimited values in 'number of values' and add another item:
Comment #54
jamesbenison CreditAttribution: jamesbenison commentedI believe pfrenssen is planning to run this show on the d7 side. His project application is pending if I am not mistaken.
Comment #55
ParadiseCircus CreditAttribution: ParadiseCircus commentedComment #56
jamesbenison CreditAttribution: jamesbenison commentedI don't like the way the drupal 7 port is done at all. It declares a new field type instead of being a field widget/formatter.
If somebody could finally answer this (http://drupal.org/node/1526940), which has been a vexing problem for me for WAY too long, I will make a proper version of this module. And you will have answered a question posed by hundreds...that has been asked by countless developers...and has never been properly answered.
For instance,
Page 99 in the book Drupal 7 Module Development uses the following example:
Yet nowhere in his book that I can find has he shown an example of how the function 'item_list__single_blog' can be created to override the function 'theme_item_list'. I've declared it every freaking way I can think of. Still it never gets called.
This is totally out of control. I have a bunch of stuff that needs to have this issue rectified before I can go forward on several projects. I'm not putting anymore hack crap code on drupal git.
This module needs several core theme functions to be overridden in order to work properly.
Comment #57
jamesbenison CreditAttribution: jamesbenison commentedIf your answer requires using
hook_theme_registry_alter()
then don't bother.If that is what is required it means that core is broken and we need to create a new issue there.
Comment #58
jamesbenison CreditAttribution: jamesbenison commentedChanging status
Comment #59
pfrenssenThe initial port done by Skilip was probably based on an old version of the module. The current D6 version has been refactored and has received a number of updates which are not present in the current D7 port. The problem is that these changes date back to the CVS days, when it was common to commit a large number of changes in one single patch. This makes merging in the latest changes to the current D7 port practically impossible.
I have made a sandbox (Link Image Field (fork)) where I have cleaned up the branches, and applied some additional patches from the queue. If you intend to make a new D7 port then maybe best start from there.
Comment #60
jamesbenison CreditAttribution: jamesbenison commentedActually that rant above was something I've been silent about for a long time.
My feeling is that in drupal 7 we should not be defining a new field at all. It should be an "image" field. And we should select the link image widget when we add it to content.
An excellent example of this is how the media module (7.x-2.x) can take a "file" field and use it for youtube, vimeo, or whatever. It should be really simple for us to take our image field and wrap it in a custom link.
The correct approach may require a pretty substantial overhaul of the module.
Comment #61
jamesbenison CreditAttribution: jamesbenison commentedOkay, I just had the pleasure of developing a new module that would stand to benefit greatly from this one (http://drupal.org/project/imageflow). And it gave me a chance to rethink my "problem" with a linked image being a new field type.
Both approaches have their advantages and disadvantages. But I can see where making this an official project as it stands would provide great benefit.
Moving this to the webmasters' queue. Challa and son of whatever have not gotten back to me despite repeated attempts.
Comment #62
jamesbenison CreditAttribution: jamesbenison commentedJohn Young just replied to me. He does not have permissions to grant me project access.
Challa said "go for it" months ago but did not grant me access. Attempts to reach him again have been unsuccessful.
This is up to the drupal admins.
Comment #63
jamesbenison CreditAttribution: jamesbenison commentedTheme hook suggestions as described above seem to NOT WORK.
From what I can tell you must use
hook_theme()
EDIT: This was supposed to be a response to #56. Even then it's still out of place. My apologies.
Comment #64
sreynen CreditAttribution: sreynen commentedSorry to delay this further, but we have a defined process for this to avoid problems. Please follow http://drupal.org/node/251466 to be added as a maintainer of the project. It sounds like you've already contacted the owner directly, so you just need to open an issue specifically about becoming maintainer. If the current owner does not approve or reject your request in 2 weeks, webmasters will then transfer ownership.
Comment #65
jenyum CreditAttribution: jenyum commentedSubscribing. Desperate for progress on this.
Comment #66
skilip CreditAttribution: skilip commentedSince I've ported the D6 version to D7, I'm also willing to take over maintainership of this module.
Comment #67
jenyum CreditAttribution: jenyum commentedSkilip and/or Jamesbenison, please open a separate issue requesting maintainership. My understanding is nothing will change until someone does that.
Comment #68
sreynen CreditAttribution: sreynen commentedjenyum, that's correct. The policy at http://drupal.org/node/251466 requires a maintainer-specific issue before webmaster intervention.
Comment #69
droath CreditAttribution: droath commentedI have been working on a fork of the "Link Image Fields" project that Skilip and Jamesbenison ported over. I have added a substantial amount of code to improve not having to define a separate field for link images. I'm willing to join forces to get this project official.
https://drupal.org/sandbox/droath/1564916
Comment #70
jenyum CreditAttribution: jenyum commentedDroath, can you start an issue asking to be a maintainer? Someone needs to do this ASAP. Three maintainers would probably be great, but we need at least one.
Comment #71
pfrenssen@jenyum, since the module has not been maintained for over two years, there's no absolutely no need to rush. Please don't put pressure on people like this. Remember people are doing this for free in their spare time.
Comment #72
alicious CreditAttribution: alicious commentedSo, as a Drupal user, how do I actually link an image without using an outdated module? I've been using Link Image but the "default image" feature is broken and every day the default image disappears. I feel like I must be missing something, since adding a link to an image is a pretty basic feature... Is there a simpler way to do this?
Comment #73
jamesbenison CreditAttribution: jamesbenison commentedI cannot lie. I tried to delay delay delay in the hopes that someone would take this project that everyone seems to need but looks at like it's the redheaded step child.
http://drupal.org/project/linkimagefields
It's official.
But PLEASE not for my sake but for the sake of other drupal users help out with this.
A co-maintainer and patches would be great places to start.
Thanks
Comment #74
jamesbenison CreditAttribution: jamesbenison commentedCore for sure handles dimensions now.
Drupal's theme image should now also handle any image attributes. I don't know if they currently work with the module because I haven't tested it recently. If they don't it shouldn't be very difficult to fix it.
The module description has long been obsolete. I will make a note.
Comment #75
sreynen CreditAttribution: sreynen commentedjamesbenison, please consider removing that project before creating releases. If you're willing to maintain the code, the existing project is the best place to do that, since everyone who has used and contributed to this project is already collaborating here. We have a clear process for taking over existing projects. Please do that rather than creating confusion with a separate project.
Comment #76
jamesbenison CreditAttribution: jamesbenison commentedI believe I went through that process after not hearing back from the original maintainer. It has been so long that I don't even remember. But I'll double check and pull down releases.
I agree that this is a much better place for it.
Comment #77
jamesbenison CreditAttribution: jamesbenison commentedThis has been ongoing for nearly a year.
http://drupal.org/project/linkimagefield
I did successfully get in touch with Challa. He told me I should go ahead and take over the project, but he never granted me maintainer permissions. I believe that was back in November. I held off on promoting a sandbox for many months, but I finally gave in (http://drupal.org/project/linkimagefields). However, as a user has correctly pointed out, it would be preferable to take over maintainership of this project as opposed to creating a new one (too late, but I can abandon it before people start downloading it).
Comment #78
Danny EnglanderMaybe I am stating the obvious but I think there is a clear set of steps and actions for taking over an existing project that has been abandoned. Dealing with unsupported (abandoned) projects At any rate, thanks for all the hard work!! :)
Comment #79
jamesbenison CreditAttribution: jamesbenison commentedPlease point out what I might have missed.
I'm kinda juggling several things right now. At a glance I didn't see anything that sticks out, but if I'm overlooking the obvious it wouldn't be the first time.
Is it the name of the issue title? Everything else looks legit.
Comment #80
sreynen CreditAttribution: sreynen commentedFrom the process:
I don't see an issue for this.
But that's irrelevant, since it appears you are already a maintainer on this project. If you aren't able to make a release, feel free to ask for help.
Comment #81
jamesbenison CreditAttribution: jamesbenison commentedEither my maintainer privileges are new or I have been blind.
I'll push the 7.x code up asap. We can take it from there.
Comment #82
jamesbenison CreditAttribution: jamesbenison commented7.x-1.x has been branched and pushed. After many long months we can finally close this thread.
The download should be available shortly.
Comment #83
pfrenssenGreat news, congratulations! Which port are you using? The one by skilip or the one by droath? I did not find the time yet to look at droath's version, but it seemed promising. As long as we are in dev we can still switch versions I guess.
Comment #84
jamesbenison CreditAttribution: jamesbenison commentedI used the one that was in my sandbox. It's effectively skilip's port with a few enhancements.
In the longer term I think the wise thing to do would be to look at droath's version and consider making it the 7.x-2.x branch. It's a pretty radical departure from the current module. To me his approach makes far more sense. We should probably start a new thread on it to get user input.
I wanted to get something up quickly that I know works. So using a fairly vanilla port for 7.x-1.x seemed like a good idea. At least now users now have official support and the drupal security teams keeping watch.
I tried to create an alpha1 last night. But, for some reason it wasn't allowing me. I don't know if I'm lacking a permission or I'm doing something wrong. But I've never had a problem with tagging a release before.
Comment #85
drupalok CreditAttribution: drupalok commentedcan you please make a dev release? please please please :)
Comment #86
drupalok CreditAttribution: drupalok commentedsorry... I was blind... its already there
Comment #87
droath CreditAttribution: droath commented@jamesbenison
I'm following up with what we talked about over here on this thread:
https://drupal.org/node/1275382#comment-6018406
Let me know if you still want to go ahead with the 7.x-2.x branch of Link Image Fields which would be based off the work I have been doing on: https://drupal.org/sandbox/droath/1564916. I'm more then willing to help co-maintain this module with you, so we can get this long awaited module a stable release.
Let me know...
Comment #88
jamesbenison CreditAttribution: jamesbenison commented@droath
I'm all on board with you. My permissions on this project are limited. If it was up to me it would already be done.
I've been busting my A for client needs the past couple weeks. When I have a chance to breath I'll get back to the fun stuff. Give me a few days and I'll see what I can do.
Thanks for the work you've put in.
Jim
Comment #89
jrochate CreditAttribution: jrochate commentedWell...
Thinking about future web searchers, here is how I link images to a link, on a view:
1. Start with a content type that has, at least, an Image field (D7 built-in) and a Link field (module)
2. Create a view and add both fields to FIELDS
3. Order fields where Content:Link comes first and Content: Image comes after
4. On Content:Link settings, choose Exclude from display
5. On Content:Image settings, set "Link image to" nothing and expand "Rewrite results"
6. Check "Output this fields as a link" and on Link path text box, insert the replacement pattern that corresponds to the Link field
(scroll down to "Replacement patters" in order to copy&paste the right pattern
7. Apply and Save
That's it.
Now you can tweak with settings, in order to get url opened on a new page, etc.
Hope that helps someone.
Comment #90
sahuni CreditAttribution: sahuni commentedwell #89 works if we do not give a text in the link field.
But if we give a text to the link field, it does not work.
Case is : in a view we want the link from the link text and in another view we want the link from the image.
In that case the link does not use the url but the text.