protected function extractPartByPosition($url, $position)
    {
        $part = null;

        if ($url !== null && $url !== '') {
            // split on the / character
            $keywords = preg_split("/\//", $url);
            // preg_match_all('/\{\%\s*([^\%\}]*)\s*\%\}|\{\{\s*([^\}\}]*)\s*\}\}/i', $url, $matches);

            //if there are some words, we pop the last
            if (count($keywords) > 0) {
                //get the part
                $part = $keywords[$position - 1];
            }
        }

        return $part;
    }