# Two columns on a \newcommand

I'm making my CV. I have the following command declared:

\newcommand{\cvevent}[4]{%
{\large\color{emphasis}#1\par}
\smallskip
\textbf{\color{accent}#2}\par
\smallskip
{\small\makebox[0.5\linewidth][l]{\faCalendar\hspace{0.5em}#3}%
\ifstrequal{#4}{}{}{\makebox[0.5\linewidth][l]{\faMapMarker\hspace{0.5em}#4}}\par}
\medskip
}

Here is a Minimum Working example of what I have:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{fontawesome}
\usepackage{etoolbox}

\newcommand{\locationsymbol}{\faMapMarker}
\newcommand{\cvevent}[4]{%
{\large#1\par}
\smallskip
\textbf{#2}\par
\smallskip
{\small\makebox[0.5\linewidth][l]{\faCalendar\hspace{0.5em}#3}%
\ifstrequal{#4}{}{}{\makebox[0.5\linewidth][l]{\faMapMarker\hspace{0.5em}#4}}\par%
}
}
\newcommand{\divider}{\textcolor{body!30}{\hdashrule{\linewidth}{0.6pt}{0.5ex}}\medskip}

\begin{document}
\cvevent{Cisco Systems}{Service Provider for AMX}{November 2017 -- April 2018}{Buenos Aires, Argentina}

\end{document}

With that I was able to do the following:

I would like to add an image as a second column like the following:

To sum up, I would like to add an image aligned to the right that takes the same height than the 3 lines on the left and that is passed as a 5th argument (and if there's no 5th argument then don't put anything.

PS: It would probably be necessary to move the "location" phrase closer to the calendar to make all fit as the document is already on two columns.

I have made a small update to your macro to get what you want:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{fontawesome}
\usepackage{etoolbox}
%https://tex.stackexchange.com/questions/413768/how-to-insert-a-logo-in-moderncv-and-keep-it-on-the-right-side-of-the-page?noredirect=1&lq=1
\newcommand{\locationsymbol}{\faMapMarker}
\newcommand{\cvevent}[7]{%
{\large#1\hfill\par}
\smallskip
{\vspace{#3em}\textbf{#2}}  \ifstrequal{#4}{}{}{\hfill\makebox[0.5\linewidth][c]{\protect\includegraphics[width=#4cm]{#5}}}\par
\smallskip
{\small\makebox[0.5\linewidth][l]{\faCalendar\hspace{0.5em}#6}%
\ifstrequal{#7}{}{}{\makebox[0.5\linewidth][l]{\faMapMarker\hspace{0.5em}#7}}\par%
}

}
\newcommand{\divider}{\textcolor{body!30}{\hdashrule{\linewidth}{0.6pt}{0.5ex}}\medskip}

\begin{document}
\cvevent{Cisco Systems}{Service Provider for AMX}
{-3}{2}{example-image-a}{November 2017 -- April 2018}{Buenos Aires, Argentina}
\end{document}

with which you will get:

In addition to your existing macro, I added a few more inputs to play with the spacing. In particular, I modified your \cvevent{event1}{event2}{event3}...{event7}. Here event3 [em] describes the vertical spacing between event1 and event2. And, event4 decribes the image width in [cm]. This is a negative space and it is ~1.5-2 times the width of event4. More importantly, event5 is your image.

To add more, I also included the graphicx package for convenience.

Note: the sole-purpose of event3 is to allow you to play with the vertical spacing of your event2 with respect to the size of your desired image which is event5 (in this case). It is worthwhile to stress that if you suppose intend to use the height parameter of an image, you can indeed add that as an event as well.

All further suggestions and improvements are welcome.