• Hi,

    I use “clever document insert” with MLA. It is simply “show documents by Category and Tags”. (Show: category = “User Manual” and Tag = “Manufacturer”.

    [mla_gallery post_mime_type=application/pdf category=esite tag=linecard mla_markup=document_list]

    ————
    style:

    
    <style type='text/css'>
    	#[+selector+] {
    		margin: auto;
    	}
    	#[+selector+] .gallery-row {
    		float: [+float+];
    		margin-top: 10px;
    		text-align: left;
    		width: [+itemwidth+]%;
    	}
    	#[+selector+] td {
    		padding: .5em;
    	}
    	#[+selector+] .gallery-row td.gallery-icon {
    		width: auto;
    		height: auto;
    		vertical-align: top;
    	}
    	#[+selector+] .gallery-row .gallery-icon img {
    		width: 76px;
    		height: 72px;
    	}
    	#[+selector+] .gallery-caption {
    		margin-left: 0;
    		vertical-align: top;
    		width: auto;
    	}
    </style>
    

    Markup:

    
    <div class="row">
    <div class="col-sm-3">[+link+]<a href="[+filelink_url+]" >Avaa tiedot<br />
    		<strong>[+file+]  </strong></a><br />
    		Koko [+file_size,kbmb+]<br />
    		[+upload_date,date('d.m.Y H:i')+]</div>
    <div class="col-sm-6"><a title="[+title+]" class="fancybox" href="[+pagelink_url+]">Lue lisää [+title+]</a>
                      <br /> 
                      <br />   
           [+caption+]</div>
    </div>
    

    mla_style=mlaelke columns=1 size=icon link=file post_mime_type=all
    <div id='[+selector+]’ class=”mla-document-gallery”>
    ——————–

    https://elkesan.fi/esitteet-ja-kayttoohjeet/

    PROBLEM IS, much documents are disappeared.

    ——————-
    This happened:
    Wordpress default setting is “save media to folders year/month”. So, all media are then 2017/01, 02… 2018/01 etc. For me this was painfull. I have only individual filenames. Also I see “update some hundred photos” it is useful make it cruel way: Do not change filenames. First photo editing, fix some media categories/tags etc. Then, using ftp, back to folder.

    MLA it is easy rebuild/reread iptc.

    Now I finalize big work: First i move all individual media to folder “uploads”.
    Then I remove year/month-folders.
    Then I update WordPress database using “Media Sync” so it read this “uploads”-folder images to database.
    Then I remove broken database links to year/month folder using “Fix media library” plugin.
    Finally I fix my page and fix direct contact to media. Eg. “a href = uploads/2018/01/xyz.jpg” etc.

    This was big work, but… for me it is easier if all media is inside one folder, not in million folders.

    ———————————-

    NOW! What is still broken, it is MLA!

    https://elkesan.fi/esitteet-ja-kayttoohjeet/

    There is only two working mla_markup. I am quite sure this working documents are inside folder uploads: I remove this “year/month”-selection start of this year so all documents and media during 2019 are under “uploads”. So this work.

    Okay,
    This working “Urmet”, I open it media in WordPress edit and there is:
    MLA Gallery in: (Page 1107), Esitteet ja Käyttöohjeet.

    Also it working “Ritto” it is same “MLA Gallery in: (Page 1107), Esitteet ja Käyttöohjeet.

    All other media “MLA Gallery in” setting is disappear.

    ——————–
    So, after this massive media crunching all is ok, but I cannot “call” media using MLA. Really, only difference I see is this setting under media this “MLA Gallery in:”.

    Hmmm… so. I am quite sure all this happen if:
    1, I move much media to “uploads”-folder using ftp,
    2, I read all media to database using Media Sync
    3, I update IPTC etc using MLA setting IPTC-tab
    —-> now all this media can found in Media or Media Library assistant. But, I am sure, it is not readable using mla-templates (as you see…).

    So, how I can “tell” to MLA (not Media, MLA) all this media is available?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author David Lingren

    (@dglingren)

    Nice to hear from you again; I regret the trouble you are having after updating your site with the Media Sync plugin. I assume you are using this plugin I found in the WordPress Repository:

    Media Sync By Erol Živina

    I installed this plugin in my system and ran some tests. When the “Sync – uploads directory” function is used to create Media Library items from files in the Uploads directory it violates WordPress conventions in (at least) three ways:

    1. The plugin stores the entire absolute path to the file in the _wp_attached_file postmeta value. WordPress stores the (path and) file name relative to the uploads directory in this value.
    2. The plugin stores the entire absolute path to the file in the Attachment Metadata file value. WordPress stores the (path and) file name relative to the uploads directory in this value.
    3. The plugin stores a corrupted combination of the site root and the absolute file path in the item’s guid value. WordPress stores a valid absolute URL in the guid value.

    These violations make it impossible for MLA to properly construct the [+filelink_url+] data source you are using in your template. In particular, the guid value is the only reliable way to get the file link URL for a PDF document because the associated WordPress function returns the URL of the document’s thumbnail image, not the document itself.

    You can try replacing [+filelink_url+] with [+base_url+]/[+file+] in your template. This worked on my system.

    Below your templates I see this in your post:

    mla_style=mlaelke columns=1 size=icon link=file post_mime_type=all
    <div id='[+selector+]’ class=”mla-document-gallery”>

    I am not sure what that refers to or how it relates to the shortcode that appears above your templates.

    You wrote “it is not readable using mla-templates“. I am not sure what that means. Do the items show up in the gallery display? Does fixing the [+filelink_url+] problem as suggested above resolve the problem?

    You wrote “All other media “MLA Gallery in” setting is disappear.” I am not sure what that means. On my system, the “MLA Gallery in” works without errors even when the corrupted values are present. If the galleries that are not working are based on category and tag values, make sure the terms assigned to the items actually match the terms selected in the [mla_gallery] shortcodes.

    You can try contacting the author of the Media Sync plugin and get them to fix the problems in their code. Failing that, I am not sure what more help I can be.

    Any additional information you can provide will be helpful. Thank you.

    Plugin Author David Lingren

    (@dglingren)

    It has been a month since my last post in this topic. I hope you have found a way around the problems with the Media Sync plugin and addressed your issue.

    I am marking this topic resolved, but please update it if you have any problems or further questions regarding the suggestions in my earlier post.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Broken link in MLA’ is closed to new replies.