What is the proper way to add an image to Morea markdown-formatted page? - morea-framework

I am trying to add an image to the landing home page. For this, I have created a folder assets within master/src/morea and placed the image there.
Then, I have added a line into home.md:
![GrammarViz 2.0 screenshot](/morea/assets/screen-front.png "GrammarViz 2.0 screenshot")
The problem is that I see the image locally (http://localhost:4000/morea/assets/screen-front.png), but it had not appeared at github, because of the erroneous URL that has "morea" instead of my repository name:http://seninp.github.io/morea/assets/screen-front.png.
Thanks!

It turns out that image URLs must be relative URLs in Morea. So, the fix is to simply remove the leading slash:
![GrammarViz 2.0 screenshot](morea/assets/screen-front.png "GrammarViz 2.0 screenshot")
Take a look at the ICS311s14 site for a working example.

Related

How to link images and pages in wordpress pages?

So, in the WordPress page, I need to link the pdf in wp-contents so I linked it with the relative URL as href="/wp-content/uploads/2017/03/test.pdf"
when I click it since my root in localhost is localhost/test it takes me to localhost/wp-content/uploads/2017/03/test.pdf (which doesn't serve the file). However, I don't think it'll be an issue in the server. Still, I want to know if this is the correct way?
Also, so I'm in page localhost/test/page22 Now on the page, I have an anchor tag as href="/page23" it takes me to page23 correctly, but when I'm in a different sub page say localhost/test/page/page2 now, the link takes me to localhost/test/page/page23 which is not correct as it should be localhost/test/page23. How can I solve these issues
WordPress provides functions for getting the URL of resources you should use these instead of having your code generate the URL. In this case you should call wp_get_attachment_url().

How to set Plugin Header image on wordpress.org

I have developed a plugin for school project to parent login/register and uploaded on WordPress plugin directory, but i am not able to sat banner image on top.
Please guide me if have any idea.
Please check this link. You will find your solution.
Source: https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/
To Add a Plugin Header Image:
Make a 772×250 pixel JPG or PNG image file. (No animated GIFs. :) )
Check it in to your plugin’s SVN directory with the path assets/banner-772x250.(jpg|png). Note that the assets directory is added to your plugin’s root directory, not trunk.
On the next plugin directory refresh (every 15 minutes or so) you should see your image start showing up on the page.
For an example of this in action, check out Hello Dolly or Pluginception for HiDPI action.
You can also make larger images, which will be used on high-DPI displays (aka ‘retina’). To do so, make a second image with the size of 1544 pizels wide and 500 pixels high. This file will be named assets/banner-1544x500.(jpg|png). Note that you can not make this image alone, it only works as an “add-on” to the 772×250 image, because this larger image is only used on displays that can show the higher detail.
To add a plugin header image in the new directory:
Make a 1880×609 pixel JPG or PNG image file. (No animated GIFs. :) )
Check it in to your plugin’s SVN directory with the path assets/banner-1880x609.(jpg|png). Note that the assets directory is added to your plugin’s root directory, not trunk.
On the next plugin directory refresh (every 15 minutes or so) you should see your image start showing up on the page.
Unlike the old plugin directory, no other plugin banner is required.
Another thing to consider is the case for the international plugin directories. Some of these, like Hebrew and Arabic, use Right-To-Left languages. In these cases, the title will be overlaid on the right hand side of the image, not on the left side. Generally it is best to design your banner such that the title can be in either position. However, this may not work with all designs, so if you need to have a different image for RTL pages, then you can do so. Make the images in the same way as before, but name them with -rtl appended to the name. So an RTL banner would be named assets/banner-772x250-rtl.(jpg|png) and assets/banner-1544x500-rtl.(jpg|png) or assets/banner-1880x609-rtl.(jpg|png) for the new directory. On RTL pages, if these images are available, then they will be displayed instead.
After you check in your new banner(s), it will appear the next time the plugin refreshes itself in the directory. This may take a few minutes.
For development and testing, you can add a URL parameter to your plugin’s URL of ?banner_url=A_URL_TO_YOUR_IMAGE to preview what the page will look like with your own image. This will only work with your own plugins; you cannot use this parameter on anybody else’s plugins.

How do I set the image path in WordPress?

I am using absolute paths for images on a WordPress site (currently in dev) but when the page loads the images are missing.
Here is an example:
<img src="/images/img_tonsmeire-properties.png" alt="tonismere" >
The only thing I can think that may be causing this is that the dev environment that I am creating this in is not at the root of the parent site. The URL for this is is:
http://opteracreative.com/~baybr/
What is the correct way to reference the images?
Thanks.
The problem was with the path. I had to add /~baybr/ in front of the image path and it worked.

Image disappear when url route

I am writing a web page to show image (image is dynamically generate by .Net charting) in a web. I have used the asp.net web forms URL routing to navigate to this page. Once I use the URL routing the image appear on the page. Anyway this is working fine for normal page browse.
More than likely your link to the image is using a relative path, and once you introduce routing you are working with a URL structure that appears to be deeper nested in the folder structure than it is.
When linking to the image for display I would recommend using root relative path something like /Images/MyFile.jpg rather than ../Images/MyFile.jpg, or similar.
This way if your route changes, and additional "folders" appear in the route, the link will still work.

Drupal paths in themes

On certain pages drupal_get_path isn't working correctly (or it is and I've got the wrong function)
The base path is wrong
Example:
Image is supposed to be at
http://domain.com/sites/all/modules/pecapture/images/headline_dontmissout.jpg
But when on
http://domain.com/node/9
The URL is
http://domain.com/node/sites/all/modules/pecapture/images/headline_dontmissout.jpg
The same happens on the page
http://domain.com/admin/build/ and block edit page
How do I get the right path?
added base_path() to beginning of my paths...
base_path (http://api.drupal.org/api/base_path), if you use php code.
In html case, just add "/", like: /sites/all/modules/pecapture/images/headline_dontmissout.jpg
One problem: if you work on subfolder (Drupal installed in internal folder of main site): http://domain.com/subfoldersite, it will not correct, becase will remove "subfoldersite".

Resources