I'm looking for a function that will allow me to select my site from a folder of images in the WordPress installation.
I have 5 images of the same size named 1.png, 2.png and so on in the folder https: //domain.tld/_wordpress/wp-content/uploads/images. I would like to attach this to a mail in Outlook via HTML (or another script).
The way to integrate individual images is known. However, one of these 5 images should be selected at random. It is about advertising and more understanding of voluntary work.
How can I do something like that?
PS: I found this code, but it doesn't work.
img src="https://www.domain.tld/_wordpress/wp-content/uploads/images/random/image _<?php $random = rand(1,2); echo $random; ?>.png" alt="Random Image" height="201" width="600" /
Perhaps an option would also be sufficient to rename a file accordingly every day under Wordpress. 001.png becomes 1.png and today's 1.png becomes 001 etc.
Then you could have a fixed link, so that the graphic is given a name corresponding to the graphic on the server side every day.
It should just be automated somehow.
Unfortunately, I have no idea how or whether something like this can be implemented.
Related
I am looking to re-design the Login page. I need to add a new background image. Let me know where should I be copying this image into the project and where should I be specifying the image reference. I see the change made directly into Login.html are not reflecting in the output.
There are two logos in Maximo Anywhere, ibmLogoDark.png and ibmLogoLight.png (for the light and dark backgounds). You will need to obtain suitable replacement (transparent backgound) logo gifs or png files from your customer, of an equivalent size.
The IBM logo image files are in:
\MaximoAnywhere\apps\WorkExecution\common\js\platform\ui\control\images\mdpi
and also in:
\MaximoAnywhere\apps\WorkExecution\common\idx\mobile\themes\common\idx\images
So that is where I put copies of my customers replacement logos.
You'll want to give them different names from the IBM logos just so they don't get overwritten so easily. There are 4 CSS files you need to update to the new name:
about.css, launch.css and login.css in:
\MaximoAnywhere\apps\WorkExecution\common\idx\mobile\themes\common\idx
and mdpi.css in
\MaximoAnywhere\apps\WorkExecution\common\js\platform\ui\control\css
There are also two app.xml files you need to update to point to the new names. One in each of:
\MaximoAnywhere\apps\WorkExecution\platform-artifacts\dialog
and
\MaximoAnywhere\apps\WorkExecution\platform-artifacts\login
Then rebuild and you're done. Oh, and make sure you clear your browser cache (or use incognito mode) to test.
I am customizing my tumblr template and I need to access the URL of the iframe that contains my photoset. When I look at the html of my tumbler page, I see:
<figure class="photoset with-caption">
<div id="photoset_66130132457" class="html_photoset">
<iframe id="photoset_iframe_66130132457" class="photoset" style="border:0px; background-color:transparent; overflow:hidden;" src="http://blog.kazoova.com/post/66130132457/photoset_iframe/kazoova/tumblr_mvtbtjxyAt1t05bsz/0/false" frameborder="0" height="535" scrolling="no" width="100%">
</iframe>
</div>
</figure>
How do I get the value of src in the iframe using tumblr variables?
I can get the URLs of individual images using the following code, but this is not what I am looking for:
{block:Photoset}
{block:Photos}
{PhotoURL-500}
{/block:Photos}
{/block:Photoset}
I am hoping there is a variable for photoset that is similar to {PhotoURL-500} like {PhotosetURL-500}.
Please help!
How to get a Photosets iframe src
Sadly, there isn't a theme operator that gives us the src as a string, the only option we have is to use {Photoset-500} as OP states. However, it is possible to work the iframe src out with the theme operators we have.
Breakdown of the iframe src
http://mikedidthis-pierre.tumblr.com/post/37187983482/photoset_iframe/mikedidthis-pierre/tumblr_meih4y5SDi1rkq61e/700/false
We can break this down into 7 parts:
http://mikedidthis-pierre.tumblr.com/post/
37187983482/
photoset_iframe/
mikedidthis-pierre/
tumblr_meih4y5SDi1rkq61e/
700/
/false
1 The URL of the Tumblr blog, prefixed with post/. 1 and 2 should be used in tandum.
2 Unique Post ID.
3 A generic, consistant sub directory.
4 At first glance looks like the Tumblr username. I wouldn't say its the Tumblr URL due to custom domains. However, it seems like it can be changed to anything, as long at it contains a character.
5 A unique Tumblr generated ID. Think reblog keys. This is the part we really need and there are no theme operators to generate this.
6 The size, in width of the iframe.
7 Shadow mode. I believe turning this to true adds drop shadows to each of the photos in a photoset.
How much of this can we replicate?
So using the available theme operators like so:
{BlogURL}/post/{PostID}/photoset_iframe/x/ * missing 5 * /700/false
We can almost generate the full src!
http://mikedidthis-pierre.tumblr.com/post/37187983482/photoset_iframe/x/ * missing 5 * /700/false
Finding 5
The bad news is, we are going to need javascript. I am not going to cover that, but I will explain how we can get the missing information. If you use the theme operators for a photoset, that just give use the image urls `{PhotoURL-500}:
http://25.media.tumblr.com/tumblr_meih4y5SDi1rkq61eo4_500.jpg
Can you see 5? Lets break it down:
http://25.media.tumblr.com/
tumblr_meih4y5SDi1rkq61e
o4
_500
.jpg
1 Address for the Tumblr server the image is hosted on.
2 The missing data 5.
3 This is the number of the image in the photoset, so 4th. However, I think this relates to upload order, rather than display order.
4 Size of the image.
5 File extension.
So now what?
So to get the complete iframe src, you are going to need to use javscript to find the data for part 5 and then combining that with the data we already have from the available theme operators.
OP hasn't stated why they need the iframe URL. I would presume for delaying the loading, maybe to do with responsive.
Hope it helps!
Proof of concept:
Image based Photoset: Example.
Iframe based Photoset using information from above: Example.
I had a similar issue - I wanted to link the photoset "captions" (headers the way we have it set up) so that all of the post headers were links and worked/looked the same.
I found #mikedidthis's answer helpful. But I played around with it a bit and I thought reconstruction the iframe src from scratch was overkill.
I went about it updating my markup with a few more classes and using the following Javascript -
$('.top.media.photoset.no-link').each(function(){
$set = $(this);
var url = $set.find('iframe').attr('src');
// console.log(url);
$set.find('.cont').find('a').attr('href',url).end().end().removeClass('no-link');
});
Since I have lazy loading on, I wanted a way to only set the href once per link, I added in the class no-link to use for selector specificity (I could have also searched for links where href != "#" as well I suppose).
On the catalog/category page I would like images change when hover. Like clubmonaco.com I know how to do it on html/css but no idea on magento. Any help?
You could modify files in this directory:
app/design/frontend/base/default/template/catalog/product
for example (list/ and list.phtml)
or your template for example:
app/design/frontend/default/yourtemplate/template/directory with product files
CSS files you can find in:
skin/frontend/
You should also think, where the second image is stored. You can use "CSS-Sprites" for this case - a single image file, that contains both photos. The disadvantage is, that you have to customize every page, where magento shows product images.
Alternatively you have to define exact orders. First image is the front view, second image is always the back view.
The programming part is not really difficult. Look at
app/design/frontend/base/default/template/catalog/product/list.phtml
for the Catalog view. Path can vary, if you have a custom template. In the Magento backend there is a feature to show up the real path (system->configuration->development tools).
You can write your Javascript directly into the list.phtml. Magento also writes JS-code directly in the .phtml files. Of course it's not very pretty, but Magento is so complex; if other people work with the shop system, it will be easier to find.
Keep in mind, that the list.phtml contains two layouts: Grid and List View. Just if you do a change and wonder, why you can't see a change in the frontend ;-)
We have a Plone 4.1 site. When I edit the HTML source of a document to use a path from the root directory (/codes in our case) and save it, Plone will translate the HTML (in our case it becomes ../codes). Is there a way to disable this, at least for this page? We cannot point to it using the file system because this is a virtual directory used to retrieve and display data from MySQL tables.
Here is some code:
<div class="agency_cd">The agency that is reporting the data. Agency codes are fixed values assigned by the National Water Information System (NWIS). A list of agency codes is available. <strong>[ <a class="internal-link" href="../codes/agency_cd_query?fmt=rdb">Tab-separated -- saved to file</a> || <a class="internal-link" href="../codes/agency_cd_query?fmt=html">HTML</a> ] </strong></div>
I change it to:
<div class="agency_cd">The agency that is reporting the data. Agency codes are fixed values assigned by the National Water Information System (NWIS). A list of agency codes is available. <strong>[ <a class="internal-link" href="/codes/agency_cd_query?fmt=rdb">Tab-separated -- saved to file</a> || <a class="internal-link" href="/codes/agency_cd_query?fmt=html">HTML</a> ] </strong></div>
I then save it, but Plone reverts it to the way it was before.
Do file a bug report on this. The component at fault is an output filter that is automatically translating absolute links to the same host to relative ones. That filter probably poses problems for various "inside-out" rewriting schemes.
Meanwhile, I'll bet you can fix this with some custom rewrite rules. Put in a rewrite rule that looks for /codes-and-parameters/codes/(.+) URLs and rewrites them to /codes/$1. That way you won't need to break anything in Plone to work around the problem.
Disable TinyMCE URL Conversions was useful although I could not say it definitely solved my problem. I found that selecting the option on the Plone edit screen to not use the visual editor and edit the HTML seemed to offer a workaround. The link though is not obvious.
Friends, i'm stuccoed with images in wordpress - please, help me understand where search for solution.
If you create webpage - www.wordpress.local/page1/01-0001 and you upload an image 01-0001 on that page, you can see, that when you'll visit www.wordpress.local/page1/01-0001, you'll see the page with image, not the page, that you created with text and images.
Any ideas how to solve it ?
PS Not renaming images :)
When you use the WordPress-uploader, the images are stored in /wp-content/uploads/, and WordPress takes care of using filenames that aren't already in use.
If you upload an image, e.g. via FTP, that has the same name as a WordPress-page, the server has to decide what it should serve; either the WordPress-page or the image. One URL = one file served.
In your case, the server decides for the image. You could of course change this configuration; but in all cases, one of the two files won't be accessible.
If you want to make both files accessible, you either need to rename the image or the WordPress-page.