replacing slice from template and querying db for new urls