# How to give \homepage link another name?

In OverleafV1 the following code could be used in moderncv

\homepage{LinkIn.com}{LinkedIn Profile}


This would hide the website (LinkedIn.com) as a piece of text "LinkedIn Profile".

After the merge ShareLatex/OverleafV2 the double brackets gives an error and only single brackets work.

I have tried to use \hyperref and \url but the document first begins a few lines under this statement which creates an error.

\usepackage{hyperref}


Using this template

Is there another way around this? thanks

EDIT:

\homepage{LinkedIn.com}{LinkedIn Profile} %This code will work in OverleafV1
same code will not work in OverleafV2 or ShareLatex but...

\homepage{LinkedIn.com} %This works in OverleafV2 or ShareLatex but as soon as a second bracket is added it doesn't hide the link in the name.


But instead puts the second bracket over the \firstname{} text on the pdf.

Maybe this is easier to understand?

EDIT 2:

\documentclass[12pt,a4paper,sans]{moderncv}

\moderncvstyle{classic}
\moderncvcolor{blue}

\usepackage{lipsum}
\usepackage[scale=0.75]{geometry}

\usepackage[danish]{babel}%Overskrift på indholdsfortegnelse dansk%
%\usepackage{hyperref}
\usepackage{multicol}
\usepackage{graphicx}

%----------------------------------------------------------------------------------------
%   NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------

% All information in this block is optional, comment out any lines you don't need
\title{A}
\extrainfo{B}
\mobile{E}
\email{F}

% The first argument is the url for the clickable link, the second argument is the url displayed in the template - this allows special characters to be displayed such as the tilde in this example

\photo[70pt][0.4pt]{billeder/BxY0owY.png}

%----------------------------------------------------------------------------------------

\begin{document}

\makecvtitle % Print the CV title

%----------------------------------------------------------------------------------------
%   EDUCATION SECTION
%----------------------------------------------------------------------------------------

\section{Education}

\cventry{2016}{A}{B}{}{}{}

\end{document}


Well, in newer versions of moderncv the command \homepage does only use one argument. You want to use two. To get this add the following line to your preamble:

\renewcommand*{\homepage}[2]{\def\@homepage{#1}\def\@homepagetitle{#2}}


Because moderncv adds \http:// instead today used \https:// I defined a new command \httpslink like

\newcommand*{\httpslink}[2][]{%
\ifthenelse{\equal{#1}{}}%
{\href{https://#2}{#2}}%
{\href{https://#2}{#1}}}


At last we have to patch in command \makecvhead the following line

\makenewline\homepagesymbol\httplink{\@homepage}


to create the homepage link you want:

\patchcmd{\makecvhead}{%search
\ifthenelse{\isundefined{\@homepage}}{}{%
\ifthenelse{\equal{\@homepagetitle}{}}% \homepagetitle could be empty
}{%success
}{%failure
}


Please see that we have to use commands \makeatletter and \makeatother because we have @ in the code above ...

So with the following compilable MWE

\documentclass[11pt,a4paper,sans]{moderncv}

\moderncvstyle{classic}
\moderncvcolor{blue}

\usepackage[scale=0.75]{geometry} % Reduce document margins

\usepackage[danish]{babel}%Overskrift på indholdsfortegnelse dansk%

\makeatletter % <=======================================================
\ifthenelse{\equal{#1}{}}%
{\href{https://#2}{#2}}%
{\href{https://#2}{#1}}}
\renewcommand*{\homepage}[2]{\def\@homepage{#1}\def\@homepagetitle{#2}}
\ifthenelse{\isundefined{\@homepage}}{}{%
\ifthenelse{\equal{\@homepagetitle}{}}% \homepagetitle could be empty
}{%success
}{%failure
}
\makeatother % <========================================================

%----------------------------------------------------------------------------------------
%   NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------

% All information in this block is optional, comment out any lines you don't need
\title{A}
\extrainfo{B}
\mobile{E}
\email{F}

% The first argument is the url for the clickable link, the second argument is the url displayed in the template - this allows special characters to be displayed such as the tilde in this example
\photo[70pt][0.4pt]{example-image}
%\quote{"A witty and playful quotation" - John Smith}

%----------------------------------------------------------------------------------------

\begin{document}

\makecvtitle % Print the CV title

%----------------------------------------------------------------------------------------
%   EDUCATION SECTION
%----------------------------------------------------------------------------------------

\section{Education}

\cventry{2016}{A}{B}{}{}{}

\end{document}


you get what you want:

moderncv has a special command to insert a link to your LinkedIn Profile without showing the complete web address: \social[linkedin]{LinkedIn Profile}

\documentclass[12pt,a4paper,sans]{moderncv}

\moderncvstyle{classic}
\moderncvcolor{blue}

\usepackage{lipsum}
\usepackage[scale=0.75]{geometry}

\usepackage[danish]{babel}%Overskrift på indholdsfortegnelse dansk%
%\usepackage{hyperref}
\usepackage{multicol}
\usepackage{graphicx}

%----------------------------------------------------------------------------------------
%   NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------

% All information in this block is optional, comment out any lines you don't need
\title{A}
\extrainfo{B}
\mobile{E}
\email{F}

% The first argument is the url for the clickable link, the second argument is the url displayed in the template - this allows special characters to be displayed such as the tilde in this example

\photo[70pt][0.4pt]{example-image}

%----------------------------------------------------------------------------------------

\begin{document}

\makecvtitle % Print the CV title

%----------------------------------------------------------------------------------------
%   EDUCATION SECTION
%----------------------------------------------------------------------------------------

\section{Education}

\cventry{2016}{A}{B}{}{}{}

\end{document}