Customize URL of a R bookdown site - r

I have written a textbook using bookdown and published it to bookdown.org/connect via RStudio. The URL is currently of the format
https://bookdown.org/connect/#/apps/x0x0x0x0z1z2z3z4etcetc/ [not the actual link!]
I believe there is a way to customize this URL to be e.g. bookdown.org/mybook. I have looked up some help guides that you can edit this by going to your access site, and clicking on the ContentURL box. When I do that it highlights the URL, but I am not able to edit it in any way - just copy it.
Is there an easy way to customize the URL?

You can use bookdown's publish_book function to add the name of your book, or the Publish to Server button in RStudio allows for a Title input field where you can also add the name of your book that will be a part of the vanity URL. Your RStudio Connect profile name should go before the name of your book, so the format would be bookdown.org/RStudio Connect profile name/name of your book/

Related

How can I explicitly link to the `index.html` file in a Quarto Book

I'm used to using bookdown to create books that don't have to be hosted on a webserver to work properly. I usually keep the _book directory and make it available on a shared drive with my team so that when my users click a link from somewhere else, they are taken into the book that lives on the OS file system.
With quarto, just about everything works similar to bookdown in this regard. However, when I try to navigate to the index.html landing page, it seems that quarto is expecting this to live on a webserver so the links don't go to book-name/index.html, they instead go to book-name/. Which throws an error when I'm using this in the file system.
Is there a way to ensure the link to the index page in my table of contents explicitly refers to book-name/index.html?
Here is the link that appears when I hover over the bookdown index link in the table of contents.
Here is the link that appears when I hover over the quarto index link in the table of contents.
But everything else in quarto links explicitly to the page it needs.
Also stumbled across this one. I don't think it's desired behavior. Solved it by setting the link manually in the sidebar.
Simply add the following key to book: in the _book.yml file:
book:
.
.
sidebar:
title: "<a href='/index.html'>Your Book Title</a>"

How to change text in WooCommerce My Account Downloads area?

In the Downloads tab of the My Account area in WooCommerce, by default the text says "No downloads available yet". I need to change this text to something more specific.
I would rather not do this by copying plugin files to my child theme, but would prefer to do it with code snippet.
If anyone can help, it would be massively appreciated.
Many thanks for your time.
If you have access to ftp you can open the folder of Woocommerce plugin into a text editor.
You can find for the string and replace it by a more specific one directly into the code.
I think it's the cleanest way.
Let me know if it works.
You have different ways of doing this:
1- Copy wp-content/plugins/woocommerce/templates/myaccount/downloads.php to your theme folder inside /woocommerce folder and overwrite the part where the string is outputted -> recommended
2- Edit the woocommerce-[LANG_CODE]_[LANG_CODE].po file inside wp-content/languages/plugins but you would lose this if you update the plugin
3- If you have WPML installed you can do it via string-translation feature
4- Edit it via JS, not so clean but hey, it would work! :D

Create page structure one time for all languages

I'm testing the Django CMS and I'm looking for a way to create the pages one time for all languages. Currently I have to create a new page for each languages and the content/plugin/structure is not shared between the different languages.
Is there a way to achieve this?
Thanks in advance
The built-in management command ./manage.py cms copy lang copies the entire page tree from one language to another. The page tree stays unchanged and the plugin trees are transferred. That is fine if you want to bootstrap a new language for the entire site.
If you want to copy the plugin trees for only one page, you can use the language menu from the toolbar: Language -> Copy all plugins if you are viewing the target language. This is fine, if you only have one page.
If you want to bootstrap a language for a page tree, i.e. a page and all its children, then you either have a lot of clicking to do, or use this short management command I created based on the original DjangoCMS ./manage.py cms copy long command. It allows to specify a page to copy either by its id or by its name in the source language (attention: it has to be unique).
Copy this snippet into any of your application's command folder: my_app/management/commands/. Once you've copied the file you'll have a new Django management command available: ./manage.py copylang. Usage examples:
./manage.py copylang --from-lang=en --to-lang=nl --tree="Home"
./manage.py copylang --from-lang=en --to-lang=nl --tree_id=36 --force
The page id needed for the --tree_id option can be easily inferred from the page admin by hovering over the page's preview icon. The page id is part of the link: .../page/page_id/lang/preview/...
If you leave out the --treeand the --tree_id options the command will revert to DjangoCMS's original cms copy lang behaviour.
The management command provided by #Fabian is quite useful.
I updated the command code here to reflect the changes in django-cms API:
# pages = [head] + list(head.children.drafts())
pages = [head] + list(head.get_child_pages().drafts())
Tested against django-cms 3.5.3 and 3.7.4.
All credits go to #Fabian.

Force path sub.domain.com/file.jpg instead of domain.com/sub/file.jpg

Is this possible?
I use: WP latest version (3.3.2) and Cpanel Followed this tutorial to accomplish this: rsatechnologies.in/serve-image-media-files-from-cookie-less-domain.html
I've just managed to move all my post images in a "cookieless subdomain" and serve them in this format (path) when a user accesses the post: img.domain.com/year/month/file.jpg (1)
Now all my old images have this format but everytime I create a new post and upload an image, the image path shown is this: domain.com/img/year/month/file.jpg (2)
So what I'm trying to do is to force the site/server to use (1) instead of (2).
I've already tried everything in Media Settings tab, the only thing working is to write in the "Store uploads in this folder" and "Full path to files" fields the subdomain name ("img" that is).
Any suggestions?
I'm thinking is a Cpanel setting I'm doing wrong.
Many thanks!
The instruction posted here http://www.jafaloo.com/2011/09/11/host-your-wordpress-images-on-subdomain-for-better-page-loading/ is good. I have all my images at http://images.freedomwall.net/year/month/image.png instead of www.freedomwall.net/wp-content/uploads/year/month/image.png

Send a file from a web page in Outlook

I have a web page that displays a list of documents stored on the web site. I need to add a link next to each document that can e-mail it. By that I mean attach the entire document to the e-mail.
When clicking the e-mail link, a 'New Message' window needs to display with:
Subject line filled in with the title of the document (displayed on the web page)
Contents of the document downloaded from the web site and added as an attachment
The mail client is Outlook. The server is SharePoint (ASP.NET) which contains web services that are able to download files. JavaScript and any JS library is available for use. I'm not able to deploy additional software to the client.
What are my options and are there any references that achieve this type of functionality?
An alternative might be to put a link in the body of the message to a place where the file can be downloaded. You could even make it a web page that deletes the file after a set time or number of downloads. To be safe you would need to use "mailto:someone#somewhere.com&subject=somesubject&body="+System.Web.HttpUtility.UrlEncode(bodyStringToEncode) to generate an html safe llink
Even with the above answer about launching an email using office automation, you'd still need to first have the file sent to the client, saved in a name and location known to the server, in order to attach the file.
I can't think of a way to attach the document but you can have a link to fill in the subject and body of an email in which you could add a link to the online document.
<a href="mailto:test#test.com?subject=
[your_subject]&body=[url_encoded_content_string]">New Message</a>
You can use this function to urlencode your body text http://phpjs.org/functions/urlencode
Hope that helps,
Josh
Using the HREF mailto, you can make outlook open with the subject at least. I don't know any way to set the body nor an attachment.
From javascript there's no way to automate Outlook using OLE.
example
Taken from:
http://www.angelfire.com/dc/html-webmaster/mailto.htm

Resources