Using Reportlab and Platypus all links point to the top of the document (not Rome) - hyperlink

I have been using Platypus & Reportlab for several weeks using Python, and would caveat this by saying that I am definitely a beginner, and my code isn't "good" code, but ...
I tend to work by looking at an example, testing it, and then adapting it to my needs...
With this approach, I managed to get a table of contents to work.
I also wanted to have a Page x of y working, which again, I found code, and after a lot of hassle, managed to get it to work with my Table of Contents, which I thought I then understood more about the applications, but ...
I had experienced links working - or not working separate to the ToCs.
However, when I merged my samples for ToC and Page x of y, I have a wonderful Toc, with links for each topic I wanted - but, the links all go to the top of the document.
I have looked at other examples I have tried, and find some where links using <a href="#MYANCHOR"... and <a name="MYANCHOR"... have the same issue.
I have also added into my main code, a link using the <a href=... but using one of the link destinations that a ToC would use - and this again jumps to the top of the document.
I put all the elements that form the document into a list called e.g. element so I would have code such as element.append(PageBreak()) and then I can print out all the element list to see what is there, and compare it to examples where it doesn't work, and I can see no significant difference.
If I provide an external link to a website (e.g. that excellent stackoverflow.com) those links work, but internal ones don't - which I accept are handled differently, but I hope it indicates where my failures lie!
I would love to understand why the links are so fickle, as I would like to get links to work in a table, and from a drawing, which to my mind should be possible, ... which may just highlight my ignorance - for which I apologise...
Any help would be really appreciated...
Many thanks,

Related

Why does images in Google spreadsheet often change their place?

I am currently working with Google Script which accepts the user input and store in the other spreadsheet. This logic works ok but to facilitate this, I have created a form like provision on my worksheet and placed some images which look like buttons. When I (and other collaborators) open this spreadsheet, we often observe that images are not on their place as shown below,
Note: See above, buttons (images) 'Get Case Details' & 'Deletegate Tasks' are not on their original positions. Ideally, they should appear as below,
As a workaround, I just go to some other tab/worksheet and come back to mine which shows the image location correctly.
I checked this discussion on Google Doc forum but looks like a known issue, no answer yet.
Does anyone have any idea? Has anyone come across this problem?
Besides the discussion that you linked, there a lot of other similar reports over the years on the Google Docs Help Forum and other places on the web.
One alternative is to increase the whitespace around the buttons. Another alternative is to use another UI element like custom menus, a side panel or dialogs.

Opencart Breadcrumb link inconsistencies

I am having similar problem in my other pages and it’s driving me crazy. I have modified a “manufacturer” module to “series”
as well as the link too.
For example, I was able to change this link:
bishounenboutique.com/manufacturer
to this:
bishounenboutique.com/series
Click on the breadcrumbs, and
the they are fine in that page. However,
if you click on top image “Psycho pass” for example in that link, it will redirect to:
bishounenboutique.com/index.php?route=product/manufacturer/product&manufacturer_id=13
(which is not what i want. Ideally I want the link to be bishounenboutique.com/psycho-pass)
But set that aside, on that page if you click on the breadcrumb link “series”, it gives:
bishounenboutique.com/index.php?route=series
but it is supposed to be:
bishounenboutique.com/series
!!!
Can anyone please give me an idea of why this is happening?
I have already enabled SEO url and renamed the htaccess file. But I don't know why it works on some links but not others.
Thank you.
Products, Manufacturers, Information Pages and Categories all have SEO keyword fields, which you can find in their DATA tabs (except for Manufacturers which is in the GENERAL tab). These need to be set for all of the above to make them work. The reason the second link you've shown doesn't work is because it's product/manufacturer/product not just product/manufacturer
EDIT
product/manufacturer/product is actually a manufacturer link - it's just poorly named by OpenCart. OpenCart still knows it is a manufacturer link and you can see that by the id that's passed along with it (manufacturer_id not product_id)
Also, OC isn't meant to rewrite it's standard URL's, only product, category, manufacturer (individual manufacturer pages not the list of manufacturers) and info pages. This works on all versions that I'm aware of so if it's not with yours, the vQmod is likely at fault and you'll need to get the developer of that to fix it
I've written a route editor mod myself that doesn't require going in and hacking up a vQmod to get it to work so I understand the complications with it

Making a website without hyperlinks

I am making a simple CMS to use in my own blog and I have been using the following code to display articles.
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("maincontent").innerHTML=xmlhttp.responseText;
}
}
What it does is it sends a request to the database and gets the content associated with the article that was clicked on and writes it to the main viewing area with ".innerHTML".
Thus I don't have actual links to other articles. I know that I can use PHP to output HTML so that it forms a link like :
<a href=getcontent.php?q=article+title>Article Title</a>
But being slightly OCD I wanted my output to be as neat as possible. Although search engine visibility is not a concern for my personal blog I intend to adapt this to a few other sites which have search engine optimization as a priority.
From what I understand, basically search engine robots follow links to index the web sites.
My question is:
Does this practice have any negative implications for search engine visibility? Also; are there other reasons for preferring one approach over the other as I see that almost every site uses the 'link' method.
The link you've written will cause a page reload. In order to leverage the standard AJAX stuff you've got at the top, you need to write the links as something along the lines of
Article Title
This assumes you have a javascript function called ajaxGet that takes an argument of the identifier for the article you're searching for.
If you were to write your entire site that way, search engines wouldn't be able to crawl you at all since they don't execute javascript. Therefore they can't get to anything off the front page. Also, even if they could follow the links, they'd have no way of referencing the page they got to since it doesn't have a unique URL. This is also annoying for users, since they can't get a link to an exact story to bookmark, send to a friend etc.

How do Google opening links in a new window without target attribute?

i wonder how google manages to open external links in a new window/tab without defining target="_blank".
For example in google plus, all external links open in a new window.
I think its some Javascript voodoo but the .js code is obfuscated so i cant really look into.
edit: oh and followup question: why?
Using a framework makes this easy. Just have JavaScript look for links marked rel="external", or another identifier that shows them to be an external link, and dynamically add target="blank". Here's an example using Prototype:
$$('a[rel="external"]').each(function(a) {
a.setAttribute('target', '_blank');
};
It's not beyond reasoning for them to add the target attribute by javascript before allowing the anchor link event to return true.
It's Javascript. You can say:
window.open('http://example.org', '_blank').focus();
But please, don't. Opening links in new windows is almost always the wrong thing to do. Seriously, good uses of this are vanishingly few. If users want a link opened in a new window, they are quite capable of doing that themselves.
Jakob Nielsen was telling people this twelve years ago. Others have taken up the cudgels. The W3C removed the target attribute from HTML 4 because it was such a bad idea. I honestly don't understand how this usage persists. Don't you find it incredibly annoying when a website does this to you? Why would you want to write a website which does this to someone else?
Which brings me to your followup question. Why did Google decide to do this? I have no answer to that, and i am completely and utterly baffled how one of the very biggest, brightest, web companies could make such an elementary mistake. But then, a lot of the Google Plus interface has very poor usability (as in, mostly worse than Facebook poor); i suspect there is an interesting story behind it. Was the project under-resourced, and thus built cheaply on top of a rapid development framework such as GWT? Was it built as a spare time project by a lone wolf with a blind spot for web architecture? Was it driven by strategy wonks who didn't care about getting the technology right? Mystery.

How to get rid of stupid "pad" labels produced by RTML functions?

I am unlucky to be in charge of maintaining some old Yahoo! Store built using their RTML-based platform.
Recently I've noticed that HTML code generated by some RTML functions is sprinkled all over with "padding images" (or whatever is the conventional name for those 1x1 pixel images used to enforce layout). I have nothing against using such images, but... all those images are supplied with an ALT attribute like this:
<img href="http://.../image1x1.gif" alt="pad">
With all due respect to the original authors of RTML, but they must have been smoking something when they came up with this "accessibility enhancement"... :-(
Anyway, here are my questions:
Does anybody know a list of all RTML functions that generate HTML with all these "pad" images?
Is there any way to get rid of all those alt="pad" attributes without rewriting a lot of RTML code?
NB: This may sound a little cynical, but improved accessibility is not the main goal here. The main goal is to stop exposing those moronic alt="pad" attributes to Google and other smart search engines. So client-side scripting is not going to help, as far as I know.
Thank you!
P.S. Probably, most of you are really lucky and never heard of RTML. Because if somebody would establish a prize for software products based on
commercial success
------------------
usability
ratio, this RTML-based "platform" would probably win the first place.
P.P.S. Apparently someone from Yahoo! finally listened, because I can no longer find those silly "pad" tags in the RTML generated for our store. Nevertheless, one of the ideas offered in response to my original question does provide a very practical solution - not just to the original problem but to any similar problem with RTML platform. See the winning answer - it's really good.
The only way I see is to have your own website front-end that will filter whatever you want from the RTML site....
for example, your rtml site is at http://rtmlusglysite.yahoo.com/store/XYZ01134 , you could host a simple PHP front-end at http:://www.example.com that would be acting like a "filtering" HTTP web proxy, so http://rtmlusglysite.yahoo.com/store/XYZ01134/item1234.rtml would be accessed by http://www.example.com/item1234.html
It's not an ideal solution, but it should work, and you could do some more fancy stuff.
Nice try from the other posters, but there is a very simple RTML command that will do it. . .
TEXT PAT-SUBST s GRAB
MULTI
HEAD
BODY
TEXT #var-with-alt-tag-equals-pad-in-it
frompat "alt=\"pad\""
topat ""
The above RTML will find all instances of alt="pad" and replace it with nothing.
Well you're right on RTML being relatively untraveled :)
Do you have a way to add your own attributes to these images tags? If so, would it be possible to override the alt attribute? If you specify alt="", I would think that would override Yahoo's... Otherwise consider putting a useful alt tag in there for the blind and dialup types.
It's the first time I'm hearing about this platform, but here is an idea: if you can add javascript to the pages, you could write a function that will run after the page has loaded and remove all the alt="pad" attributes from the page.
Unfortunately this solutions works only with browsers that know about scripting, so lynx or some other text based browsers might not support it.
I have shared a link official RTML guide from yahoo. Hope it will help. Thanks!
List of available RTML books and resources

Resources