Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Jukka K?hk?nen

    (@elkesan)

    Second problem looks no problem- reason Wp automatically scale it image. So filename is also “scaled”. So it is not problem.

    But first problem is really big problem. It really big problem. If load eg. 100 images, it take many days edit all permalink. So how force MLA use filename as permalink?

    Plugin Author David Lingren

    (@dglingren)

    It’s good to hear from you again; it has been a few years since your last topic.

    You wrote “When adding this image using MLA…” I want to clarify that MLA uses core WordPress functions for uploading Media Library Items. The Media/Upload New Media screen is generated and processed by WordPress, not MLA. MLA adds a “Bulk Edit Area” to this screen and processes anything entered there after WordPress completes the upload process.

    During the upload process, WordPress (not MLA) generates a unique permalink/slug value. WordPress also generates a Title based on image metadata or the item file name. For “mass import” you can change the Title by defining an IPTC/EXIF/WP mapping rule or by entering a template in the Bulk Edit Area. You can also define a mapping rule to change the Name/Slug value during the upload process.

    As you have discovered, the Title and permalink can be changed on the Media/Edit Media screen, described here:

    Edit media page

    There it says:

    Permalink

    This is the URL of the media attachment page. There is also a link to view the attachment page. Next to this, there may be a button to edit the permalink—if there isn’t, you can change the permalink by activating ‘Slug’ from the screen options and changing the slug’s value.

    You can also define a mapping rule to change the Name/Slug value during the upload process or when processing the mapping rules. The permalinks you give in your post usually go to a “Media Page” defined by your theme. In your site they go directly to the image file. This is unusual and may be a feature of your theme. I am not sure that changing the permalink value will change this behavior. You have edited some permalinks manually – does this fix the problem? Can you give me an example of a changed permalink? Do I understand correctly that you want the permalink to be something like https://elkesan.fi/10876330? If you want to try the mapping rule approach I can give you more specific guidance.

    The image you gave as an example, 10876330.jpg, is very large – 4937×3862 pixels. By default, WordPress “scales” images larger than 2560×2003 pixels as described in this blog post:

    Introducing handling of big images in WordPress 5.3

    In that post you can find filters for changing the scaling threshold or disabling the scaling function. The current MLA version does not have a user interface for these filters, but there are several other plugins that have them.

    In the [mla_gallery] shortcode you can link to the original file by adding a link=original parameter to the shortcode.

    I hope that gives you a better understanding of how WordPress handles the upload process and the limited role MLA plays. I am marking this topic resolved because I have answered your questions but please update it if you have problems or further questions regarding the above explanation or if you want to try a mapping rule. Thank you for your long-time interest in the plugin.

    Thread Starter Jukka K?hk?nen

    (@elkesan)

    Thank you very much. This plugin is extremely best plugin ever. “All you need is MLA”- and “if need more, it additional plugin must be compatible with MLA”. As Justified Image Grid. ??

    Ok, this clarify very much. It is wordpress handle it image load.

    I found one interesting detail: When import pdf, permalink is pdf filename. So, just with PDF this “permalink = filename” work.
    Just as this:
    https://elkesan.fi/elkesan-tuotteet-ulko-ovelle/
    And there eg.
    https://elkesan.fi/d10000876/
    (For curiosity, this page links are made using MLA:

    Elkesan Oy messinkitaulu sek? tyylitaulut
    [justified_image_grid ids=1649]
    Jaloter?ksen lis?ksi valikoimissamme on tyylitaulut, joiden materiaali on messinki? tai kuparia erilaisilla pinnoitevaihtoehdoilla.
    [mla_gallery ids=1695 mla_markup=mlaelke]

    )

    Original filename of this document is D10000876A_linea5000.pdf, and WP make permalink https://elkesan.fi/d10000876A_linea5000.pdf but in pdf-files I accept a little “permalink manager”. But when import images, eg. jpg, permalink is not filename- WordPress make permalink using Exif/IPTC-field “headline”. Not filename.

    So: With pdf-files permalink is ok, filename. But with imagefiles Wp not use filename, and this is wrong. Summa summarum: I must read all WordPress settings fix this problem. Or make any special code fix this problem. If you found any MLA-issue fix this problem, please inform me.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update with the positive MLA feedback and your remaining issues. There are no WordPress settings I know of that will change the way it assigns permalinks for Media Library items.

    As I suggested earlier, I believe you can define an MLA mapping rule that will assign the name portion of the file name as the permalink value. To define and activate the rule, follow these steps:

    1. Go to the Settings/Media Library Assistant IPTC/EXIF/WP tab.
    2. If you want to apply the rule to new items as they are uploaded, check the “Enable IPTC/EXIF Mapping when adding new media” and “Enable IPTC/EXIF Mapping when updating media metadata” boxes.
    3. Click the “Standard (6)” link above the table to filter the list.
    4. Find the rule “Name/Slug” that will define the permalink.
    5. Hover over the rule name and click the “Edit” rollover action.
    6. In the “IPTC Value” dropdown control leave the default, “- None (select a value) -” value in place.
    7. In the “EXIF/Template Value” text box, enter
      template:([+meta:original_image,match('/[^.]+/')+]|[+name_only+])
      This assigns the name portion of the file to the permalink and works for all items including “scaled” images.
    8. In the “Priority” dropdown, select “EXIF”.
    9. In the “Existing Text” dropdown, select “Replace” to replace the current field content.
    10. In the “Status” text box, select “Active”.
    11. Scroll down to the bottom of the screen and click “Update”.

    Once you define the rule you can update existing items by applying the rule to a single item, multiple items or all items:

    • To map a single item, go to the Media/Assistant submenu and click the thumbnail of the item you want (or click the “Edit” rollover action) to get the Media/Edit Media screen. You can click the “Map IPTC/EXIF metadata” link to run your rules on this item, then look at the “Slug” text box to inspect the results. Make sure you have the “Slug” screen options box checked
    • To map two or more items, go to the Media/Assistant submenu and click the checkbox next to the items you want. Then, select “Edit” from the “Bulk Actions” dropdown above the checkboxes and click “Apply” to open the Bulk Edit area. Click the “Map IPTC/EXIF metadata” button to run your rule on the selected items.
    • To map all of your items, stay on the Settings/Media Library Assistant IPTC/EXIF tab and click the “Execute” rollover action for your custom rule. This may take a while.

    The first two methods will apply all active IPTC/EXIF rules to the selected item(s). This won’t be a problem if you have only the one active rule, but the third method might be the best if you have other rules in place.

    CAUTION: This method replaces all existing permalink values. Don’t use the third method until you are sure the rule is working to your satisfaction.

    I hope that gives you what you need for your application. Let me know if you have problems or further questions regarding the above suggestions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.